Wifi country code setting now creates wpa_supplicant.conf if it doesn't exist.

This commit is contained in:
spl 2016-03-02 10:16:52 +00:00 committed by Serge Schneider
parent b03f0ece9f
commit 1becd779ed

View File

@ -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