1#!/bin/sh 2 3DAEMON_PATH=/usr/sbin/tcf-agent 4DAEMON_NAME=tcf-agent 5DAEMON_ARGS="-L- -l0" 6 7PIDFILE=/var/run/$DAEMON_NAME.pid 8[ -r /etc/default/$DAEMON_NAME ] && . /etc/default/$DAEMON_NAME 9 10start() { 11 printf "Starting $DAEMON_NAME: " 12 start-stop-daemon -S -o -q -p $PIDFILE -m -b \ 13 -x $DAEMON_PATH -- $DAEMON_ARGS 14 15 [ $? = 0 ] && echo "OK" || echo "FAIL" 16} 17 18stop() { 19 printf "Stopping $DAEMON_NAME: " 20 start-stop-daemon -K -o -q -p $PIDFILE \ 21 -x $DAEMON_PATH 22 23 [ $? = 0 ] && echo "OK" || echo "FAIL" 24} 25 26case "$1" in 27 start) 28 start 29 ;; 30 stop) 31 stop 32 ;; 33 restart|reload) 34 stop 35 start 36 ;; 37 *) 38 echo "Usage: $0 {start|stop|restart}" 39 exit 1 40esac 41