1 #!/bin/sh /etc/rc.common
5 pidfile=/var/run/ahcpd.pid
7 config_get ifname $1 ifname
8 append interfaces "$ifname"
14 config_list_foreach $cfg interface addif
15 [ -z "$interfaces" ] && return 0
16 config_get_bool no_config "$cfg" no_config 0
17 config_get_bool ipv4_only "$cfg" ipv4_only 0
18 config_get_bool ipv6_only "$cfg" ipv6_only 0
19 config_get_bool no_dns "$cfg" no_dns 0
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} \
46 config_foreach ahcpd_config ahcpd
50 [ -e $pidfile ] && kill $(cat $pidfile)
51 [ -e $pidfile ] && sleep 2
52 [ -e $pidfile ] && sleep 4
53 [ -e $pidfile ] && echo "Failed to stop ahcpd ($pidfile still exists)."