mirror of
https://github.com/garywill/linux-router.git
synced 2025-12-30 18:58:28 +01:00
rfkill unblock wifi if needed
This commit is contained in:
10
lnxrouter
10
lnxrouter
@@ -499,7 +499,7 @@ get_phy_device() { # only for wifi interface
|
||||
}
|
||||
|
||||
get_adapter_info() { # only for wifi interface
|
||||
local PHY
|
||||
#local PHY
|
||||
PHY=$(get_phy_device "$1")
|
||||
[[ $? -ne 0 ]] && return 1
|
||||
iw phy $PHY info
|
||||
@@ -1685,6 +1685,14 @@ if [[ -n "$NEW_MACADDR" ]]; then
|
||||
ip link set dev ${SUBNET_IFACE} address ${NEW_MACADDR} || die "Failed setting new MAC address"
|
||||
fi
|
||||
|
||||
|
||||
if [[ $WIFI_IFACE ]]; then
|
||||
if which rfkill > /dev/null 2>&1 ; then
|
||||
PHY=$(get_phy_device ${SUBNET_IFACE})
|
||||
[[ -n $PHY ]] && rfkill unblock $(rfkill | grep $PHY | awk '{print $1}') >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
|
||||
ip link set up dev ${SUBNET_IFACE} || die "Failed bringing ${SUBNET_IFACE} up"
|
||||
|
||||
if [[ $WIFI_IFACE ]]; then
|
||||
|
||||
Reference in New Issue
Block a user