1 #!/bin/sh /etc/rc.common
5 pidfile
=/var
/run
/ahcpd.pid
9 config_get interfaces
"$cfg" interfaces
10 config_get_bool no_ipv4
"$cfg" no_ipv4
0
11 config_get_bool no_dns
"$cfg" no_dns
0
16 config_foreach ahcpd_config ahcpd
18 [ -r /usr
/lib
/ahcp
/ahcp.dat
] && authority
="-a /usr/lib/ahcp/ahcp.dat"
19 if [ "$no_ipv4" -eq 0 ]; then
22 if [ "$no_dns" -eq 0 ]; then
25 if [ -e $pidfile ] ; then
26 echo "$pidfile exists -- not starting ahcpd." >&2
28 /usr
/sbin
/ahcpd
-D -I $pidfile ${no_ipv4:+-s} ${no_dns:+-N} $authority $interfaces
33 [ -e $pidfile ] && kill $
(cat $pidfile)
34 [ -e $pidfile ] && sleep 2
35 [ -e $pidfile ] && sleep 4
36 [ -e $pidfile ] && echo "Failed to stop ahcpd ($pidfile still exists)."