From 0c055b6ab7a713a73ce9103c257521d86f88ff4a Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Wed, 28 Feb 2018 17:30:37 +0000 Subject: [PATCH] Setting Wi-Fi country no longer requires a reboot --- debian/changelog | 6 ++++++ debian/control | 2 +- raspi-config | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9953f4d..e3577a4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +raspi-config (20180228) stretch; urgency=medium + + * Setting Wi-Fi country no longer requires a reboot + + -- Serge Schneider Wed, 28 Feb 2018 17:28:50 +0000 + raspi-config (20171201) stretch; urgency=medium * Add pixel doubling option diff --git a/debian/control b/debian/control index e64be2c..ef0492c 100644 --- a/debian/control +++ b/debian/control @@ -10,6 +10,6 @@ Vcs-Browser: https://github.com/RPi-Distro/raspi-config Package: raspi-config Architecture: all Depends: ${misc:Depends}, whiptail, parted, lua5.1, alsa-utils, psmisc -Recommends: triggerhappy +Recommends: triggerhappy, iw Description: Raspberry Pi configuration tool A simple configuration tool for common Raspberry Pi administrative tasks diff --git a/raspi-config b/raspi-config index b6b49dc..4f8c2a7 100755 --- a/raspi-config +++ b/raspi-config @@ -447,10 +447,15 @@ do_wifi_country() { else echo "country=$COUNTRY" > /etc/wpa_supplicant/wpa_supplicant.conf fi + if ! iw reg set "$COUNTRY" 2> /dev/null; then + ASK_TO_REBOOT=1 + fi + if [ -f /run/wifi-country-unset ] && hash rfkill 2> /dev/null; then + rfkill unblock wifi + fi if [ "$INTERACTIVE" = True ]; then whiptail --msgbox "Wi-fi country set to $COUNTRY" 20 60 1 fi - ASK_TO_REBOOT=1 fi IFS=$oIFS }