#! /bin/sh # /etc/init.d/scannedonlyd: start the scannedonly daemon. ### BEGIN INIT INFO # Provides: scannedonlyd # Required-Start: \$syslog # Required-Stop: \$syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Scannedonly daemon ### END INIT INFO PATH=/bin:/usr/bin:/sbin:/usr/sbin pidfile=/var/run/scannedonlyd.pid binpath=/usr/local/sbin/scannedonlyd_clamav START=no test ! -r /etc/default/scannedonlyd || . /etc/default/scannedonlyd [ "\$START" != "yes" ] && exit 0 . /lib/lsb/init-functions if [ -n "\$DAEMON_BIN" ] then if [ -x "\$DAEMON_BIN" ] then binpath="\$DAEMON_BIN" else log_warning_msg "\$DAEMON_BIN is not executable.\\ Use default binary." fi fi test -f \$binpath || exit 0 ARGS="--scanroot=\$SCANROOT -t \$NB_THREADS -l \$LOG_LEVEL \\ -b \$BIG_FILE_SIZE -i \$pidfile" if [ -n "\$PORT" ] then ARGS="\$ARGS -p \$PORT" else ARGS="\$ARGS -s \$SOCKET" fi case "\$1" in start) log_begin_msg "Starting scannedonly daemon" start-stop-daemon --start --quiet --pidfile \$pidfile\\ --name scannedonlyd_cl --startas \$binpath -- \$ARGS log_end_msg \$? ;; stop) log_begin_msg "Stopping scannedonly daemon" start-stop-daemon --stop --quiet --retry 3\\ --exec \$binpath --pidfile \$pidfile log_end_msg \$? ;; restart|force-reload) log_begin_msg "Reloading scannedonly daemon" start-stop-daemon --stop --quiet --retry 3 \\ --exec \$binpath --pidfile \$pidfile start-stop-daemon --start --quiet --pidfile \$pidfile \\ --name scannedonlyd_cl --startas \$binpath -- \$ARGS log_end_msg \$? ;; *) log_success_msg "Usage: \$0 \{start|stop|restart|force-reload\}" exit 1 esac exit 0