Allow expansion of private_interfaces
[openresolv] / resolvconf.in
index 49cb10a736d1e0236ba5c42986cb419d1678b3af..c0298b47ae587286b0fc96167341b83ab980c6cc 100644 (file)
@@ -101,7 +101,7 @@ echo_resolv()
 parse_resolv()
 {
        local line= ns= ds= search= d= n= newns=
-       local new=true iface= private=false
+       local new=true iface= private=false p=
 
        echo "DOMAINS="
        echo "SEARCH="
@@ -113,18 +113,19 @@ parse_resolv()
                        if ${new}; then
                                iface="${line#\# resolv.conf from *}"
                                new=false
-                               case " $private_interfaces " in
-                               *" $iface "*)
+                               if [ -e "$PRIVATEDIR/$iface" ]; then
                                        private=true
-                                       ;;
-                               *)
-                                       if [ -e "$PRIVATEDIR/$iface" ]; then
-                                               private=true
-                                       else
-                                               private=false
-                                       fi
-                                       ;;
-                               esac
+                               else
+                                       # Allow expansion
+                                       cd "$IFACEDIR"
+                                       private=false
+                                       for p in $private_interfaces; do
+                                               if [ "$p" = "$iface" ]; then
+                                                       private=true
+                                                       break
+                                               fi
+                                       done
+                               fi
                        fi
                        ;;
                "nameserver "*)