1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

typo, use double quotes, always restart netplan wifi

This commit is contained in:
Jerry Vonau 2023-04-19 10:38:50 -05:00
parent 27c3b1b9a0
commit 5341cc6ca2
2 changed files with 6 additions and 3 deletions

View file

@ -29,14 +29,14 @@ fi
if [ -f /run/netplan/wpa-$IFACE.conf ]; then
SSID=`grep ssid /run/netplan/wpa-$IFACE.conf | awk -F = '{print $2}' | sed -r s/\"// | sed -r s/\"//`
REG_DOM=$(grep country /run/netplan/wpa-$IFACE.conf | awk -F = '{ print $2 }')
if [ -z "$REG_DOM" ]; then
NETPLAN=1
if [ -z "$REG_DOM" ]; then
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
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
sed -i "s|^country.*|country_code=$REG_DOM|" /etc/hostapd/hostapd.conf.iiab
cp /etc/hostapd/hostapd.conf.iiab /etc/hostapd/hostapd.conf
fi
fi

View file

@ -13,6 +13,9 @@ if [ "$IFACE" == "{{ discovered_wireless_iface }}" ]; then
systemctl stop wpa_supplicant
systemctl restart hostapd
systemctl start wpa_supplicant
if [ -f /run/netplan/wpa-wlan0.conf ]; then
systemctl restart netplan-wpa-wlan0.service
fi
else
echo "Upstream Channel greater than 13 or is the same - not changing hostapd.conf"
fi