mirror of
https://github.com/brain-hackers/brain-config.git
synced 2025-01-03 18:10:07 +09:00
Wifi country code setting now creates wpa_supplicant.conf if it doesn't exist.
This commit is contained in:
parent
b03f0ece9f
commit
1becd779ed
@ -283,11 +283,15 @@ do_configure_wifi_country() {
|
|||||||
true
|
true
|
||||||
fi
|
fi
|
||||||
if [ $? -eq 0 ];then
|
if [ $? -eq 0 ];then
|
||||||
|
if [ -e /etc/wpa_supplicant/wpa_supplicant.conf ]; then
|
||||||
if grep -q "^country=" /etc/wpa_supplicant/wpa_supplicant.conf ; then
|
if grep -q "^country=" /etc/wpa_supplicant/wpa_supplicant.conf ; then
|
||||||
sed -i "s/^country=.*/country=$COUNTRY/g" /etc/wpa_supplicant/wpa_supplicant.conf
|
sed -i "s/^country=.*/country=$COUNTRY/g" /etc/wpa_supplicant/wpa_supplicant.conf
|
||||||
else
|
else
|
||||||
sed -i "1i country=$COUNTRY" /etc/wpa_supplicant/wpa_supplicant.conf
|
sed -i "1i country=$COUNTRY" /etc/wpa_supplicant/wpa_supplicant.conf
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "country=$COUNTRY" > /etc/wpa_supplicant/wpa_supplicant.conf
|
||||||
|
fi
|
||||||
if [ "$INTERACTIVE" = True ]; then
|
if [ "$INTERACTIVE" = True ]; then
|
||||||
whiptail --msgbox "Wi-fi country set to $COUNTRY" 20 60 1
|
whiptail --msgbox "Wi-fi country set to $COUNTRY" 20 60 1
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user