Blame | Last modification | View Log | RSS feed
#!/bin/bashNAME=ocsinventory-agentexec >>/var/log/$NAME/$NAME.log 2>&1[ -f /etc/sysconfig/$NAME ] || exit 0source /etc/sysconfig/$NAMEexport PATHi=0while [ $i -lt ${#OCSMODE[*]} ]doif [ ${OCSMODE[$i]:-none} == cron ]; thenOPTS=if [ ! -z "${OCSPAUSE[$i]}" ]; thenOPTS="--wait ${OCSPAUSE[$i]}"fiif [ ! -z "${OCSTAG[$i]}" ]; thenOPTS="$OPTS --tag=${OCSTAG[$i]}"fiif [ "z${OCSSERVER[$i]}" = 'zlocal' ]; then# Local inventoryOPTS="$OPTS --local=/var/lib/$NAME"elif [ ! -z "${OCSSERVER[$i]}" ]; then# Remote inventoryOPTS="$OPTS --lazy --server=${OCSSERVER[$i]}"fiecho "[$(date '+%c')] Running $NAME $OPTS"/usr/sbin/$NAME $OPTSfi((i++))doneecho "[$(date '+%c')] End of cron job ($PATH)"