summaryrefslogtreecommitdiff
path: root/openwrt/package/base-files/default/etc
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2005-11-19 19:04:15 +0000
committerFelix Fietkau <nbd@openwrt.org>2005-11-19 19:04:15 +0000
commit81668c7ab947e41f9a3a667ecf32545001d367e3 (patch)
treec656238021e382ce9f16f89c9e5dfade3850937f /openwrt/package/base-files/default/etc
parent969a4d1c2a55b9def4c4576816ffe37f357e0f94 (diff)
downloadmtk-20170518-81668c7ab947e41f9a3a667ecf32545001d367e3.zip
mtk-20170518-81668c7ab947e41f9a3a667ecf32545001d367e3.tar.gz
mtk-20170518-81668c7ab947e41f9a3a667ecf32545001d367e3.tar.bz2
more fixes for the network scripts
SVN-Revision: 2537
Diffstat (limited to 'openwrt/package/base-files/default/etc')
-rw-r--r--openwrt/package/base-files/default/etc/hotplug.d/net/10-net39
1 files changed, 19 insertions, 20 deletions
diff --git a/openwrt/package/base-files/default/etc/hotplug.d/net/10-net b/openwrt/package/base-files/default/etc/hotplug.d/net/10-net
index 3bc980f..19f53ab 100644
--- a/openwrt/package/base-files/default/etc/hotplug.d/net/10-net
+++ b/openwrt/package/base-files/default/etc/hotplug.d/net/10-net
@@ -23,22 +23,21 @@ find_name()
IFTYPE="${ifname}"
IFPROTO="$(nvram get ${IFTYPE}_proto)"
IFACE="$(nvram get ${IFTYPE}_ifname)"
- [ -z "$IFPROTO" -o "$IFPROTO" = "none" ] || {
- [ "${IFACE}" = "$INTERFACE" ] && return 0
- case "$IFPROTO" in
- static|dhcp)
- [ "${IFACE%%[0-9]*}" = "br" ] && {
- for part in $(nvram get ${IFTYPE}_ifnames); do
- [ "$part" = "$INTERFACE" ] && return 0
- done
- }
- ;;
- *)
- [ "$(nvram get ${IFPROTO}_ifname)" = "$INTERFACE" \
- -a -x /sbin/ifup.${IFPROTO} ] && return 0
- ;;
- esac
- }
+ case "$IFPROTO" in
+ ""|none);;
+ static|dhcp)
+ [ "${IFACE}" = "$INTERFACE" ] && return 0
+ [ "${IFACE%%[0-9]*}" = "br" ] && {
+ for part in $(nvram get ${IFTYPE}_ifnames); do
+ [ "$part" = "$INTERFACE" ] && return 0
+ done
+ }
+ ;;
+ *)
+ [ "$(nvram get ${IFPROTO}_ifname)" = "$INTERFACE" \
+ -a -x /sbin/ifup.${IFPROTO} ] && return 0
+ ;;
+ esac
done
IFACE=""
IFTYPE=""
@@ -155,13 +154,12 @@ do_register()
do_ifup "$IFPROTO" "$IFTYPE" "$if"
fi
}
- else
- do_ifup "$IFPROTO" "$IFTYPE" "$if"
+ else
+ [ "${INTERFACE%%[0-9]*}" = "ppp" ] || do_ifup "$IFPROTO" "$IFTYPE" "$if"
fi
}
do_unregister() {
- [ "${INTERFACE%%[0-9]*}" = "atm" ] || ifconfig "$INTERFACE" 0.0.0.0 down 2>&-
[ -z "$IFTYPE" -o -z "$IFPROTO" ] && find_name
[ -z "$IFTYPE" -o -z "$IFPROTO" ] && return 0
@@ -175,13 +173,14 @@ do_unregister() {
case "$IFPROTO" in
pppoe|pppoa|pptp)
- killall ifup.${IFPROTO} 2>&- >&-
killall pppd 2>&- >&-
;;
dhcp)
[ -f /var/run/${INTERFACE}.pid ] && kill "$(cat /var/run/${INTERFACE}.pid)" 2>&- >&-
;;
esac
+
+ [ "${INTERFACE%%[0-9]*}" = "atm" ] || ifconfig "$INTERFACE" 0.0.0.0 down 2>&-
}
case "$ACTION" in