diff options
Diffstat (limited to 'main/nfdump/nfcapd.initd')
-rw-r--r-- | main/nfdump/nfcapd.initd | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/main/nfdump/nfcapd.initd b/main/nfdump/nfcapd.initd index 5f8506812..028cf55ee 100644 --- a/main/nfdump/nfcapd.initd +++ b/main/nfdump/nfcapd.initd @@ -28,13 +28,12 @@ start() { [ "${COMPRESS}" == "yes" ] && OPTS="${OPTS} -z" for optname in p:PORT b:BINDHOST j:MULTICASTGROUP i:IFACE R:REPEAT \ I:IDENT l:BASEDIR n:SOURCE s:SAMPLERATE S:SUBDIR \ - T:EXTENSIONS t:INTERVAL x:ROTATECMD u:UID g:GID \ + T:EXTENSIONS t:INTERVAL u:UID g:GID \ B:BUFFLEN ; do opt="${optname/:*}" optvar="${optname/*:}" eval optvalue="\$$optvar" [ -n "$optvalue" ] && OPTS="${OPTS} -${opt} ${optvalue}" done - OPTS="${OPTS}" # Attempt to make the basedir if specified if [ -n "${BASEDIR}" ]; then @@ -42,10 +41,17 @@ start() { chown "${UID}":"${GID}" "${BASEDIR}" fi + # Handle remote command as a special case + if [ -n "${ROTATECMD}" ]; then + start-stop-daemon --start -b --exec $BIN \ + --pidfile ${PIDFILE} --make-pidfile \ + -- ${OPTS} -x "${ROTATECMD}" + else + start-stop-daemon --start -b --exec $BIN \ + --pidfile ${PIDFILE} --make-pidfile \ + -- ${OPTS} + fi - start-stop-daemon --start -b --exec $BIN \ - --pidfile ${PIDFILE} --make-pidfile \ - -- ${OPTS} eend $? } |