From 593de24f30c926af67a62cb2031258c7dad827a3 Mon Sep 17 00:00:00 2001 From: Jonatan Schlag Date: Sat, 31 Dec 2016 15:04:05 +0100 Subject: [PATCH] Use a better naming scheme for physical devices. Instead of orange0phys we should use orangephys0 this patch implements the necessary changes. Signed-off-by: Jonatan Schlag Signed-off-by: Michael Tremer --- config/udev/network-hotplug-bridges | 3 ++- config/udev/network-hotplug-rename | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/udev/network-hotplug-bridges b/config/udev/network-hotplug-bridges index 514b45de12..5144a7712d 100644 --- a/config/udev/network-hotplug-bridges +++ b/config/udev/network-hotplug-bridges @@ -26,7 +26,8 @@ eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings) detect_zone() { - local intf="${INTERFACE%0*}" + local intf="${INTERFACE%?}" + intf="${intf%phys}" intf="${intf^^}" local zone diff --git a/config/udev/network-hotplug-rename b/config/udev/network-hotplug-rename index 294bb78625..3a482d2dbf 100644 --- a/config/udev/network-hotplug-rename +++ b/config/udev/network-hotplug-rename @@ -69,7 +69,7 @@ for zone in ${ZONES}; do # print the name to which udev will rename it. case "${!mode}" in bridge) - echo "${!device}phys" + echo "${!device%0}phys0" ;; macvtap) @@ -78,7 +78,7 @@ for zone in ${ZONES}; do logger -t network "MACVTAP mode is not supported for wireless devices" echo "${!device}" else - echo "${!device}phys" + echo "${!device%0}phys0" fi ;; -- 2.39.2