diff options
Diffstat (limited to 'fusioninventory-agent.init')
-rwxr-xr-x | fusioninventory-agent.init | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fusioninventory-agent.init b/fusioninventory-agent.init index aacadab..65fd96d 100755 --- a/fusioninventory-agent.init +++ b/fusioninventory-agent.init @@ -27,6 +27,7 @@ do_start() # Read configuration i=0 OPTS= + SERVERS= while [ $i -lt ${#OCSMODE[*]} ] do if [ ${OCSMODE[$i]:-none} == daemon ]; then @@ -38,11 +39,18 @@ do_start() OPTS="$OPTS --local=/var/lib/$prog" elif [ ! -z "${OCSSERVER[$i]}" ]; then # Remote inventory - OPTS="$OPTS --server=${OCSSERVER[$i]}" + if [ -z "$SERVERS" ]; then + SERVERS=${OCSSERVER[$i]} + else + SERVERS="$SERVERS,${OCSSERVER[$i]}" + fi fi fi ((i++)) done + if [ -n "$SERVERS" ]; then + OPTS="$OPTS --server=$SERVERS" + fi if [ -n "$OPTS" ]; then echo -n $"Starting $prog: " daemon $prog --logfile=$logfile $FUSINVOPT --daemon $OPTS 2>/dev/null |