[package] ahcpd: update to 0.51, fix scripts
[openwrt/svn-archive/archive.git] / ipv6 / ahcpd / files / ahcpd.init
1 #!/bin/sh /etc/rc.common
2
3 START=71
4 PID_F="/var/run/ahcpd.pid"
5 EXTRA_COMMANDS="status"
6 EXTRA_HELP=" status Print ahcpd's status to the log file."
7
8 . /lib/network/ahcp.sh
9
10 start() {
11 mkdir -p /var/lib
12 config_load ahcpd
13 unset args
14 unset interfaces
15 config_foreach ahcp_config ahcpd
16 config_foreach ahcp_server ahcpd
17 [ -z "$interfaces" ] && return 0
18 eval "/usr/sbin/ahcpd -D -I $PID_F $args $interfaces"
19 }
20
21 stop() {
22 [ -f "$PID_F" ] && kill $(cat "$PID_F")
23 }
24
25 status() {
26 [ -f $PID_F ] && kill -USR1 $(cat $PID_F)
27 }
28
29 reload() {
30 [ -f $PID_F ] && kill -USR2 $(cat $PID_F)
31 }