1#!/bin/sh 2 3NAME=minissdpd 4PIDFILE=/var/run/$NAME.pid 5DAEMON=/usr/sbin/$NAME 6CFGFILE=/etc/default/$NAME 7 8IFACE=eth0 9 10# Read configuration variable file if it is present 11if [ -f $CFGFILE ]; then 12 . $CFGFILE 13fi 14 15DAEMON_ARGS="-i $IFACE" 16 17start() { 18 printf "Starting $NAME: " 19 start-stop-daemon -S -q -m -b -p $PIDFILE --exec $DAEMON -- $DAEMON_ARGS 20 [ $? = 0 ] && echo "OK" || echo "FAIL" 21} 22stop() { 23 printf "Stopping $NAME: " 24 start-stop-daemon -K -q -p $PIDFILE 25 [ $? = 0 ] && echo "OK" || echo "FAIL" 26} 27restart() { 28 stop 29 start 30} 31 32case "$1" in 33 start) 34 start 35 ;; 36 stop) 37 stop 38 ;; 39 restart|reload) 40 restart 41 ;; 42 *) 43 echo "Usage: $0 {start|stop|restart}" 44 exit 1 45esac 46 47exit $? 48