[PATCH] ahcpd: fix ticket 3550
[openwrt/svn-archive/archive.git] / ipv6 / ahcpd / files / ahcpd.init
index a885c5477b56de617f4b13fae11be7a8484874eb..efd80d3c4270d4d76bdb0256b59623aa93d72d45 100644 (file)
@@ -7,8 +7,8 @@ pidfile=/var/run/ahcpd.pid
 ahcpd_config() {
        local cfg="$1"
        config_get interfaces "$cfg" interfaces
-       config_get no_ipv4 "$cfg" no_ipv4
-       config_get no_dns "$cfg" no_dns
+       config_get_bool no_ipv4 "$cfg" no_ipv4 0
+       config_get_bool no_dns "$cfg" no_dns 0
 }
 
 start() {
@@ -16,6 +16,12 @@ start() {
        config_foreach ahcpd_config ahcpd
        mkdir -p /var/lib
        [ -r /usr/lib/ahcp/ahcp.dat ] && authority="-a /usr/lib/ahcp/ahcp.dat"
+       if [ "$no_ipv4" -eq 0 ]; then
+               unset no_ipv4
+       fi
+       if [ "$no_dns" -eq 0 ]; then
+               unset no_dns
+       fi
        if [ -e $pidfile ] ; then
                echo "$pidfile exists -- not starting ahcpd." >&2
        else