Update Installer.sh

Made changes to Wifi config to display the correct IP address
This commit is contained in:
Beeranco 2023-08-14 23:41:37 +02:00 committed by GitHub
parent 8b06deaa7a
commit b3484ab3a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,8 +13,6 @@ PKGI="${PKGM} install -y"
PKRM="$PKGM remove --purge -y" PKRM="$PKGM remove --purge -y"
PKARM="$PKGM autoremove -y" PKARM="$PKGM autoremove -y"
DATE=$(date "+%d-%m-%Y") DATE=$(date "+%d-%m-%Y")
IP=`hostname -I`
IP=$(echo $IP | tr -d ' ')
REPO=PiAutomation REPO=PiAutomation
GIT=https://raw.githubusercontent.com/Beeranco GIT=https://raw.githubusercontent.com/Beeranco
BRANCH=main BRANCH=main
@ -110,8 +108,10 @@ echo "127.0.1.1 $HOST" >> /etc/hosts
if grep -q "country=NL" /etc/wpa_supplicant/wpa_supplicant.conf if grep -q "country=NL" /etc/wpa_supplicant/wpa_supplicant.conf
then then
IP=`hostname -I` && IP=$(echo $IP | cut -d' ' -f2,3)
rfkill unblock wifi rfkill unblock wifi
else else
IP=`hostname -I` && IP=$(echo $IP | cut -d ' ' -f 1)
echo "country=NL" >> /etc/wpa_supplicant/wpa_supplicant.conf echo "country=NL" >> /etc/wpa_supplicant/wpa_supplicant.conf
rfkill unblock wifi rfkill unblock wifi
fi fi