diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-12-24 15:50:26 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-12-24 15:50:26 +0000 |
commit | 09154e4efec109021467a887002f24447305c51c (patch) | |
tree | 0ae070c1ec828011cfb456086335abf17c46576c /main/busybox-initscripts/default.script | |
parent | 525c419c22406cb4c50112d1cfe4a614a12ff14e (diff) | |
download | aports-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.script | 6 |
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() { |