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:
parent
27c3b1b9a0
commit
5341cc6ca2
2 changed files with 6 additions and 3 deletions
|
@ -29,14 +29,14 @@ fi
|
||||||
if [ -f /run/netplan/wpa-$IFACE.conf ]; then
|
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/\"//`
|
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 }')
|
REG_DOM=$(grep country /run/netplan/wpa-$IFACE.conf | awk -F = '{ print $2 }')
|
||||||
|
NETPLAN=1
|
||||||
if [ -z "$REG_DOM" ]; then
|
if [ -z "$REG_DOM" ]; then
|
||||||
NETPLAN=1
|
|
||||||
echo "cover netplan wifi client lack of country="
|
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
|
else
|
||||||
echo "set hostapd wifi country to $REG_DOM"
|
echo "set hostapd wifi country to $REG_DOM"
|
||||||
if [ -f /etc/hostapd/hostapd.conf.iiab ]; then
|
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
|
cp /etc/hostapd/hostapd.conf.iiab /etc/hostapd/hostapd.conf
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -13,6 +13,9 @@ if [ "$IFACE" == "{{ discovered_wireless_iface }}" ]; then
|
||||||
systemctl stop wpa_supplicant
|
systemctl stop wpa_supplicant
|
||||||
systemctl restart hostapd
|
systemctl restart hostapd
|
||||||
systemctl start wpa_supplicant
|
systemctl start wpa_supplicant
|
||||||
|
if [ -f /run/netplan/wpa-wlan0.conf ]; then
|
||||||
|
systemctl restart netplan-wpa-wlan0.service
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "Upstream Channel greater than 13 or is the same - not changing hostapd.conf"
|
echo "Upstream Channel greater than 13 or is the same - not changing hostapd.conf"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue