From 02996db3ba642944401135dab8daedf0f4922c54 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 15 Aug 2010 20:33:20 +0200 Subject: import fusioninventory-agent* --- fusioninventory-agent.cron | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 fusioninventory-agent.cron (limited to 'fusioninventory-agent.cron') diff --git a/fusioninventory-agent.cron b/fusioninventory-agent.cron new file mode 100644 index 0000000..e09c0db --- /dev/null +++ b/fusioninventory-agent.cron @@ -0,0 +1,37 @@ +#!/bin/bash +NAME=fusioninventory-agent +LOG=/var/log/$NAME/$NAME.log + +exec >>$LOG 2>&1 + +[ -f /etc/sysconfig/$NAME ] || exit 0 +source /etc/sysconfig/$NAME +export PATH + +i=0 +while [ $i -lt ${#OCSMODE[*]} ] +do + if [ ${OCSMODE[$i]:-none} == cron ]; then + OPTS= + if [ ! -z "${OCSPAUSE[$i]}" ]; then + OPTS="--wait ${OCSPAUSE[$i]}" + fi + + if [ ! -z "${OCSTAG[$i]}" ]; then + OPTS="$OPTS --tag=${OCSTAG[$i]}" + fi + + if [ "z${OCSSERVER[$i]}" = 'zlocal' ]; then + # Local inventory + OPTS="$OPTS --local=/var/lib/$NAME" + elif [ ! -z "${OCSSERVER[$i]}" ]; then + # Remote inventory + OPTS="$OPTS --lazy --server=${OCSSERVER[$i]}" + fi + echo "[$(date '+%c')] Running $NAME $OPTS" + /usr/bin/$NAME $FUSINVOPT --logfile=$LOG $OPTS + fi + ((i++)) +done +echo "[$(date '+%c')] End of cron job ($PATH)" + -- cgit