updated on Fri Jan 13 04:01:25 UTC 2012
[aur-mirror.git] / udhcp / udhcpd
blob6a04ad4e1f6c1f4473a01f713000f7f0bb422f6b
1 #!/bin/bash
3 # general config
4 . /etc/rc.conf
5 . /etc/rc.d/functions
7 PID=`cat /var/run/udhcpd.pid 2> /dev/null`
9 case "$1" in
10 start)
11 stat_busy "Starting udhcpd"
12 [ -z "$PID" ] && /usr/sbin/udhcpd &> /dev/null
13 if [ $? -gt 0 ]; then
14 stat_fail
15 else
16 add_daemon udhcpd
17 stat_done
20 stop)
21 stat_busy "Stopping udhcpd"
22 [ ! -z "$PID" ] && kill $PID &> /dev/null
23 if [ $? -gt 0 ]; then
24 stat_fail
25 else
26 rm_daemon udhcpd
27 stat_done
30 restart)
31 $0 stop
32 sleep 1
33 $0 start
36 echo "usage: $0 {start|stop|restart}"
37 esac