diff options
Diffstat (limited to 'meta/packages/busybox/files/busybox-httpd')
-rwxr-xr-x | meta/packages/busybox/files/busybox-httpd | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/meta/packages/busybox/files/busybox-httpd b/meta/packages/busybox/files/busybox-httpd new file mode 100755 index 0000000000..c8348e54a7 --- /dev/null +++ b/meta/packages/busybox/files/busybox-httpd | |||
@@ -0,0 +1,44 @@ | |||
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 | ||