summaryrefslogtreecommitdiff
path: root/openwrt/package/base-files/default/etc/functions.sh
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2005-11-07 01:12:51 +0000
committerFelix Fietkau <nbd@openwrt.org>2005-11-07 01:12:51 +0000
commit2e8e51060ffcc46bb1308d7eae4d2bc3456deacf (patch)
treec82e5b250e3389ec4e4fe8ef16361eae61572845 /openwrt/package/base-files/default/etc/functions.sh
parent14a88822fd3f6883af5b4d66f584a3254202fd29 (diff)
downloadmtk-20170518-2e8e51060ffcc46bb1308d7eae4d2bc3456deacf.zip
mtk-20170518-2e8e51060ffcc46bb1308d7eae4d2bc3456deacf.tar.gz
mtk-20170518-2e8e51060ffcc46bb1308d7eae4d2bc3456deacf.tar.bz2
add hotplug stuff to trunk/
SVN-Revision: 2364
Diffstat (limited to 'openwrt/package/base-files/default/etc/functions.sh')
-rwxr-xr-xopenwrt/package/base-files/default/etc/functions.sh15
1 files changed, 9 insertions, 6 deletions
diff --git a/openwrt/package/base-files/default/etc/functions.sh b/openwrt/package/base-files/default/etc/functions.sh
index bc9767f..9cfc802 100755
--- a/openwrt/package/base-files/default/etc/functions.sh
+++ b/openwrt/package/base-files/default/etc/functions.sh
@@ -41,12 +41,14 @@ do_ifup() {
$DEBUG ifconfig $if $ip ${netmask:+netmask $netmask} broadcast + up
${gateway:+$DEBUG route add default gw $gateway}
- [ -f /etc/resolv.conf ] && return
-
- debug "# --- creating /etc/resolv.conf ---"
- for dns in $(nvram get ${2}_dns); do
- echo "nameserver $dns" >> /etc/resolv.conf
- done
+ [ -f /etc/resolv.conf ] || {
+ debug "# --- creating /etc/resolv.conf ---"
+ for dns in $(nvram get ${2}_dns); do
+ echo "nameserver $dns" >> /etc/resolv.conf
+ done
+ }
+
+ env -i ACTION="ifup" INTERFACE="${2}" PROTO=static /sbin/hotplug "iface" &
;;
dhcp)
DHCP_IP=$(nvram get ${2}_ipaddr)
@@ -64,6 +66,7 @@ do_ifup() {
sleep 1
kill -9 $oldpid
}
+ # hotplug events are handled by /usr/share/udhcpc/default.script
;;
none|"")
;;