Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 - 1
#!/bin/bash
2
NAME=ocsinventory-agent
3
 
4
exec >>/var/log/$NAME/$NAME.log 2>&1
5
 
6
[ -f   /etc/sysconfig/$NAME ] || exit 0
7
source /etc/sysconfig/$NAME
8
export PATH
9
 
10
i=0
11
while [ $i -lt ${#OCSMODE[*]} ]
12
do
13
	if [ ${OCSMODE[$i]:-none} == cron ]; then
14
		OPTS=
15
		if [ ! -z "${OCSPAUSE[$i]}" ]; then
16
			OPTS="--wait ${OCSPAUSE[$i]}"
17
		fi
18
 
19
		if [ ! -z "${OCSTAG[$i]}" ]; then
20
		        OPTS="$OPTS --tag=${OCSTAG[$i]}"
21
		fi
22
 
23
		if [ "z${OCSSERVER[$i]}" = 'zlocal' ]; then
24
	        	# Local inventory
25
	        	OPTS="$OPTS --local=/var/lib/$NAME"
179 - 26
 
4 - 27
		elif [ ! -z "${OCSSERVER[$i]}" ]; then
28
	        	# Remote inventory
179 - 29
		        OPTS="$OPTS --lazy --nolocal --server=${OCSSERVER[$i]}"
4 - 30
		fi
179 - 31
 
4 - 32
		echo "[$(date '+%c')] Running $NAME $OPTS"
33
		/usr/sbin/$NAME  $OPTS
34
	fi
35
	((i++))
36
done
37
echo "[$(date '+%c')] End of cron job ($PATH)"
38