summaryrefslogtreecommitdiffstats
path: root/main/busybox-initscripts/default.script
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-12-24 15:50:26 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-12-24 15:50:26 +0000
commit09154e4efec109021467a887002f24447305c51c (patch)
tree0ae070c1ec828011cfb456086335abf17c46576c /main/busybox-initscripts/default.script
parent525c419c22406cb4c50112d1cfe4a614a12ff14e (diff)
downloadaports-09154e4efec109021467a887002f24447305c51c.tar.bz2
aports-09154e4efec109021467a887002f24447305c51c.tar.xz
main/busybox-initscripts: udhcpc: find the interface even if we dont have /sys
Needed for LXC
Diffstat (limited to 'main/busybox-initscripts/default.script')
-rw-r--r--main/busybox-initscripts/default.script6
1 files changed, 5 insertions, 1 deletions
diff --git a/main/busybox-initscripts/default.script b/main/busybox-initscripts/default.script
index 5447080ec..1231ea9c9 100644
--- a/main/busybox-initscripts/default.script
+++ b/main/busybox-initscripts/default.script
@@ -39,7 +39,11 @@ is_wifi() {
}
if_index() {
- cat /sys/class/net/$interface/ifindex
+ if [ -e /sys/class/net/$interface/ifindex ]; then
+ cat /sys/class/net/$interface/ifindex
+ else
+ ip link show dev $interface | head -n1 | cut -d: -f1
+ fi
}
calc_metric() {