From c4619cf7d81c70d2a07daaaafa59c1dc6aa1f35e Mon Sep 17 00:00:00 2001 From: Beeranco <49772805+Beeranco@users.noreply.github.com> Date: Tue, 15 Aug 2023 17:38:27 +0200 Subject: [PATCH] Update Installer.sh Fixed Wifi IP check --- Installer.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Installer.sh b/Installer.sh index 20acc97..794beec 100644 --- a/Installer.sh +++ b/Installer.sh @@ -113,19 +113,19 @@ hostnamectl set-hostname $HOST sed -i '/raspberrypi/d' /etc/hosts echo "127.0.1.1 $HOST" >> /etc/hosts -if grep -q "country=NL" /etc/wpa_supplicant/wpa_supplicant.conf -then - IP=`hostname -I` && IP=$(echo $IP | cut -d' ' -f2,3) - rfkill unblock wifi -else - IP=`hostname -I` && IP=$(echo $IP | cut -d ' ' -f 1) - echo "country=NL" >> /etc/wpa_supplicant/wpa_supplicant.conf - rfkill unblock wifi +if grep -q "ssid=" /etc/wpa_supplicant/wpa_supplicant.conf + then + IP=`hostname -I` && IP=$(echo $IP | cut -d' ' -f2,3) + rfkill unblock wifi + else + IP=`hostname -I` && IP=$(echo $IP | cut -d ' ' -f 1) + echo "country=NL" >> /etc/wpa_supplicant/wpa_supplicant.conf + rfkill unblock wifi fi if grep -q "Amsterdam" <<< "$TZDATA"; then echo "Timezone properly configured" -else + else timedatectl set-timezone Europe/Amsterdam fi