aboutsummaryrefslogtreecommitdiffstats
path: root/main/busybox-initscripts/default.script
diff options
context:
space:
mode:
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 5447080ec9..1231ea9c9f 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() {