mirror of
https://github.com/brain-hackers/brain-config.git
synced 2024-12-22 20:20:06 +09:00
Use wpa_cli to check WiFi country setting
This commit is contained in:
parent
15d2601316
commit
999037b870
6
debian/changelog
vendored
6
debian/changelog
vendored
@ -1,3 +1,9 @@
|
|||||||
|
raspi-config (20190502) buster; urgency=medium
|
||||||
|
|
||||||
|
* Use wpa_cli to check WiFi country setting
|
||||||
|
|
||||||
|
-- Serge Schneider <serge@raspberrypi.org> Thu, 02 May 2019 13:22:49 +0100
|
||||||
|
|
||||||
raspi-config (20190429) buster; urgency=medium
|
raspi-config (20190429) buster; urgency=medium
|
||||||
|
|
||||||
* Update do_wifi_country
|
* Update do_wifi_country
|
||||||
|
20
raspi-config
20
raspi-config
@ -429,7 +429,25 @@ do_change_timezone() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get_wifi_country() {
|
get_wifi_country() {
|
||||||
grep country= /etc/wpa_supplicant/wpa_supplicant.conf | cut -d "=" -f 2
|
IFACE="$(list_wlan_interfaces | head -n 1)"
|
||||||
|
if [ -z "$IFACE" ]; then
|
||||||
|
if [ "$INTERACTIVE" = True ]; then
|
||||||
|
whiptail --msgbox "No wireless interface found" 20 60
|
||||||
|
fi
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if ! wpa_cli -i "$IFACE" status > /dev/null 2>&1; then
|
||||||
|
if [ "$INTERACTIVE" = True ]; then
|
||||||
|
whiptail --msgbox "Could not communicate with wpa_supplicant" 20 60
|
||||||
|
fi
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
wpa_cli -i "$IFACE" reconfigure > /dev/null 2>&1
|
||||||
|
COUNTRY="$(wpa_cli -i "$IFACE" get country)"
|
||||||
|
if [ "$COUNTRY" = "FAIL" ]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
echo "$COUNTRY"
|
||||||
}
|
}
|
||||||
|
|
||||||
do_wifi_country() {
|
do_wifi_country() {
|
||||||
|
Loading…
Reference in New Issue
Block a user