aboutsummaryrefslogtreecommitdiff
path: root/network
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2009-09-24 14:47:02 -0700
committerAaron Griffin <aaronmgriffin@gmail.com>2009-09-24 14:47:02 -0700
commitacac4f47597320f55995bdaf692d6f2335a1d67e (patch)
tree5b64cf25a9ffca0a5dd369eb0a1e194c69cc7948 /network
parentc3276e250c88173f36ddd50bc6a6c4feeb7409cb (diff)
downloadinitscripts-acac4f47597320f55995bdaf692d6f2335a1d67e.tar.xz
network: Use real interface name for ifconfig up
Using the variable name doesn't work in cases like this: my_interface_foo="eth0 blah blah" INTERFACES=(my_interface_foo) It produces errors like so: my_interface_foo no such device Fixes FS#16114 Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'network')
-rwxr-xr-xnetwork8
1 files changed, 6 insertions, 2 deletions
diff --git a/network b/network
index 35982b9..de144a2 100755
--- a/network
+++ b/network
@@ -19,11 +19,15 @@ ifup()
return 1
fi
- /sbin/ifconfig $1 up
+ eval ifcfg="\$${1}"
+
+ # Get the name of the interface from the first token in the string
+ ifname=${ifcfg%% *}
+
+ /sbin/ifconfig $ifname up
wi_up $1 || return 1
- eval ifcfg="\$${1}"
if [ "$ifcfg" = "dhcp" ]; then
# remove the .pid file if it exists
/bin/rm -f /var/run/dhcpcd-${1}.pid >/dev/null 2>&1