mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-12 18:41:51 +00:00
Fix omr-rename disable
This commit is contained in:
parent
29f0b61c7b
commit
acf29d0bb7
1 changed files with 3 additions and 2 deletions
|
@ -23,7 +23,7 @@ _set_intf_name() {
|
|||
chk_modalias=$MODALIAS
|
||||
[ -z "$chk_modalias" ] && chk_modalias="$(cat /sys/class/net/${INTERFACE}/device/uevent | grep MODALIAS | cut -d '=' -f2 | tr -d '\n')"
|
||||
if [ -n "$chk_modalias" ]; then
|
||||
logger -t "OMR-Rename" "dir: $i - modalias: $modalias - chk_modalias: $chk_modalias - ifname: $ifname - INTERFACE: $INTERFACE"
|
||||
logger -t "OMR-Rename" "modalias: $modalias - chk_modalias: $chk_modalias - ifname: $ifname - INTERFACE: $INTERFACE"
|
||||
if [ "$modalias" = "$chk_modalias" ] && [ "$INTERFACE" != "$ifname" ]; then
|
||||
logger -t "OMR-Rename" "Rename ${INTERFACE} to ${ifname}"
|
||||
existif=0
|
||||
|
@ -45,6 +45,7 @@ _set_intf_name() {
|
|||
fi
|
||||
}
|
||||
[ -z "$modalias" ] && [ -n "$device" ] && [ -n "$ifname" ] && [ "/sys${DEVPATH}" = "$device" ] && [ "$INTERFACE" != "$ifname" ] && {
|
||||
logger -t "OMR-Rename" "device: $device - devpath: $DEVPATH - ifname: $ifname - INTERFACE: $INTERFACE"
|
||||
logger -t "OMR-Rename" "Rename ${INTERFACE} to ${ifname}"
|
||||
ip link set ${INTERFACE} down 2>&1 >/dev/null
|
||||
existif=0
|
||||
|
@ -58,7 +59,7 @@ _set_intf_name() {
|
|||
}
|
||||
}
|
||||
|
||||
if [ "$(uci -q get openmptcprouter.settings.disableintfrename)" != "0" ]; then
|
||||
if [ "$(uci -q get openmptcprouter.settings.disableintfrename)" != "1" ]; then
|
||||
config_load network
|
||||
config_foreach _set_intf_name interface
|
||||
config_foreach _set_intf_name interface
|
||||
|
|
Loading…
Reference in a new issue