fix ifup (no longer use the to-be-reverted state of the previous config)
[openwrt-10.03/.git] / package / base-files / files / sbin / ifdown
index 7cc87deb77878b2bf0ef2c9dd70ccce02d2b5a2f..883f8ec42893bc8c3fb70286a6674f1430deeeac 100755 (executable)
@@ -4,6 +4,7 @@
 . /etc/functions.sh
 [ $# = 0 ] && { echo "  $0 <group>"; exit; }
 [ "x$1" = "x-a" ] && {
+       [ -e "/tmp/resolv.conf.auto" ] && rm /tmp/resolv.conf.auto
        config_cb() {
                [ interface != "$1" -o -z "$2" ] || eval "$0 $2"
        }
@@ -64,4 +65,8 @@ config_get iftype "$cfg" type
 # remove the interface's network state
 uci_revert_state network "$1"
 
-
+# revert aliases state as well
+config_get aliases "$1" aliases
+for config in $aliases; do
+       uci_revert_state network "$config"
+done