diff options
Diffstat (limited to 'meta/packages/busybox/files/busybox-udhcpd')
-rwxr-xr-x | meta/packages/busybox/files/busybox-udhcpd | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/meta/packages/busybox/files/busybox-udhcpd b/meta/packages/busybox/files/busybox-udhcpd new file mode 100755 index 0000000000..c43903e8dc --- /dev/null +++ b/meta/packages/busybox/files/busybox-udhcpd | |||
@@ -0,0 +1,43 @@ | |||
1 | #!/bin/sh | ||
2 | DAEMON=/usr/sbin/udhcpd | ||
3 | NAME=udhcpd | ||
4 | DESC="Busybox UDHCP Server" | ||
5 | ARGS="/etc/udhcpd.conf" | ||
6 | |||
7 | test -f $DAEMON || exit 1 | ||
8 | |||
9 | set -e | ||
10 | |||
11 | case "$1" in | ||
12 | start) | ||
13 | echo -n "starting $DESC: $NAME... " | ||
14 | if [ ! -f /etc/udhcpd.conf ]; then | ||
15 | echo "error: /etc/udhcpd.conf is missing." | ||
16 | exit 1 | ||
17 | fi | ||
18 | /sbin/start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS | ||
19 | echo "done." | ||
20 | ;; | ||
21 | stop) | ||
22 | echo -n "stopping $DESC: $NAME... " | ||
23 | /sbin/start-stop-daemon -K -n $NAME | ||
24 | echo "done." | ||
25 | ;; | ||
26 | restart) | ||
27 | echo "restarting $DESC: $NAME... " | ||
28 | $0 stop | ||
29 | $0 start | ||
30 | echo "done." | ||
31 | ;; | ||
32 | reload) | ||
33 | echo -n "reloading $DESC: $NAME... " | ||
34 | killall -HUP $(basename ${DAEMON}) | ||
35 | echo "done." | ||
36 | ;; | ||
37 | *) | ||
38 | echo "Usage: $0 {start|stop|restart|reload}" | ||
39 | exit 1 | ||
40 | ;; | ||
41 | esac | ||
42 | |||
43 | exit 0 | ||