]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/busybox/files/busybox-httpd
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / busybox / files / busybox-httpd
1 #!/bin/sh
2 DAEMON=/usr/sbin/httpd
3 NAME=httpd
4 DESC="Busybox HTTP Daemon"
5 HTTPROOT="/srv/www"
6 ARGS="-h $HTTPROOT"
7
8 test -f $DAEMON || exit 0
9
10 set -e
11
12 case "$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         ;;
42 esac
43
44 exit 0