1#!/bin/sh 2DAEMON=/usr/sbin/httpd 3NAME=httpd 4DESC="Busybox HTTP Daemon" 5HTTPROOT="/srv/www" 6ARGS="-h $HTTPROOT" 7 8test -f $DAEMON || exit 0 9 10set -e 11 12case "$1" in 13 start) 14 echo -n "starting $DESC: $NAME... " 15 if [ ! -d $HTTPROOT ]; then 16 echo "$HTTPROOT is missing." 17 exit 1 18 fi 19 start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS 20 echo "done." 21 ;; 22 stop) 23 echo -n "stopping $DESC: $NAME... " 24 start-stop-daemon -K -n $NAME 25 echo "done." 26 ;; 27 restart) 28 echo "restarting $DESC: $NAME... " 29 $0 stop 30 $0 start 31 echo "done." 32 ;; 33 reload) 34 echo -n "reloading $DESC: $NAME... " 35 killall -HUP $(basename ${DAEMON}) 36 echo "done." 37 ;; 38 *) 39 echo "Usage: $0 {start|stop|restart|reload}" 40 exit 1 41 ;; 42esac 43 44exit 0 45