mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
clearer logic
This commit is contained in:
parent
e63028f8ee
commit
f79f4c0f46
1 changed files with 14 additions and 9 deletions
|
@ -26,17 +26,22 @@ fi
|
||||||
# https://bugs.launchpad.net/ubuntu/+source/linux-firmware/+bug/1862760
|
# https://bugs.launchpad.net/ubuntu/+source/linux-firmware/+bug/1862760
|
||||||
# https://bugs.launchpad.net/netplan/+bug/1951586
|
# https://bugs.launchpad.net/netplan/+bug/1951586
|
||||||
# WiFi country code progress on arm64 OS's discussed on #3078
|
# WiFi country code progress on arm64 OS's discussed on #3078
|
||||||
if [ -f /run/netplan/wpa-$IFACE.conf ] && $(grep country /run/netplan/wpa-$IFACE.conf); then
|
if [ -f /run/netplan/wpa-$IFACE.conf ]; then
|
||||||
REG_DOM=$(grep country /run/netplan/wpa-$IFACE.conf | awk -F = '{ print $2 }')
|
|
||||||
sed -i -e "s/^country.*/country=$REG_DOM/" /etc/hostapd/hostapd.conf.iiab
|
|
||||||
cp /etc/hostapd/hostapd.conf.iiab /etc/hostapd/hostapd.conf
|
|
||||||
else
|
|
||||||
NETPLAN=1
|
|
||||||
SSID=`grep ssid /run/netplan/wpa-$IFACE.conf | awk -F = '{print $2}' | sed -r s/\"// | sed -r s/\"//`
|
SSID=`grep ssid /run/netplan/wpa-$IFACE.conf | awk -F = '{print $2}' | sed -r s/\"// | sed -r s/\"//`
|
||||||
echo "cover netplan lack of country="
|
REG_DOM=$(grep country /run/netplan/wpa-$IFACE.conf | awk -F = '{ print $2 }')
|
||||||
sed -i 's|ctrl_interface=/run/wpa_supplicant|&\ncountry={{ host_country_code }}|' /run/netplan/wpa-$IFACE.conf
|
if [ -z "$REG_DOM" ]; then
|
||||||
|
NETPLAN=1
|
||||||
|
echo "cover netplan wifi client lack of country="
|
||||||
|
sed -i 's|ctrl_interface=/run/wpa_supplicant|&\ncountry={{ host_country_code }}|' /run/netplan/wpa-$IFACE.conf
|
||||||
|
else
|
||||||
|
echo "set hostapd wifi country to $REG_DOM"
|
||||||
|
if [ -f /etc/hostapd/hostapd.conf.iiab ]; then
|
||||||
|
sed -i 's|^country.*|country=$REG_DOM|' /etc/hostapd/hostapd.conf.iiab
|
||||||
|
cp /etc/hostapd/hostapd.conf.iiab /etc/hostapd/hostapd.conf
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# IIAB hint for NetworkManager
|
# IIAB hint for NetworkManager
|
||||||
# could scrape /etc/NetworkManager/system-connections/ looking for ssid
|
# could scrape /etc/NetworkManager/system-connections/ looking for ssid
|
||||||
if [ -f /etc/iiab/iiab.env ]; then
|
if [ -f /etc/iiab/iiab.env ]; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue