1 #!/bin/sh /etc/rc.common
5 pidfile=/var/run/ahcpd.pid
9 config_get interfaces "$cfg" interfaces
10 config_get_bool no_config "$cfg" no_config 0
11 config_get_bool ipv4_only "$cfg" ipv4_only 0
12 config_get_bool ipv6_only "$cfg" ipv6_only 0
13 config_get_bool no_dns "$cfg" no_dns 0
18 config_foreach ahcpd_config ahcpd
20 if [ "$no_config" -eq 0 ]; then
23 if [ "$ipv4_only" -eq 0 ]; then
26 if [ "$ipv6_only" -eq 0 ]; then
29 if [ "$no_dns" -eq 0 ]; then
32 if [ -e $pidfile ] ; then
33 echo "$pidfile exists -- not starting ahcpd." >&2
35 /usr/sbin/ahcpd -s /usr/lib/ahcp/ahcp-config.sh -D -I $pidfile \
36 ${ipv4_only:+-4} ${ipv6_only:+-6} ${no_dns:+-N} ${no_config:+-n} \
42 [ -e $pidfile ] && kill $(cat $pidfile)
43 [ -e $pidfile ] && sleep 2
44 [ -e $pidfile ] && sleep 4
45 [ -e $pidfile ] && echo "Failed to stop ahcpd ($pidfile still exists)."