From 49d8506d3fecc4b41315646b04e6281d07d01162 Mon Sep 17 00:00:00 2001 From: Beeranco <49772805+Beeranco@users.noreply.github.com> Date: Sat, 12 Aug 2023 03:03:44 +0200 Subject: [PATCH] Update Installer.sh Added Wifi and Timezone check --- Installer.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Installer.sh b/Installer.sh index a2a8e0f..e958403 100644 --- a/Installer.sh +++ b/Installer.sh @@ -61,8 +61,9 @@ fi TERM=ansi whiptail --title "Pre-Check" --infobox "Please wait..." 8 78 sleep 3 -ping -c 1 192.168.1.102 > /dev/null && HOSTUP=yes || HOSTUP=no +TZDATA=`timedatectl` +ping -c 1 192.168.1.102 > /dev/null && HOSTUP=yes || HOSTUP=no if [[ $HOSTUP == yes ]]; then echo > /dev/tcp/192.168.1.102/80 && echo 'Acquire::http::Proxy "http://192.168.1.102:80";'> /etc/apt/apt.conf.d/01prox || TERM=ansi whiptail --title "Pre-Check" --infobox "Not using an APT-Cache server" 8 78 sleep 3 @@ -88,8 +89,22 @@ OPTIONS=$(whiptail --title "Configure Options" --checklist \ TERM=ansi whiptail --title "Pi Automation" --infobox "Configuring Raspberry Pi" 8 78 sleep 3 -echo "country=NL" >> /etc/wpa_supplicant/wpa_supplicant.conf -rfkill unblock wifi + +if grep -Fxq "country=NL" /etc/wpa_supplicant/wpa_supplicant.conf +then + echo "Wifi properly configured" +else + echo "country=NL" >> /etc/wpa_supplicant/wpa_supplicant.conf + rfkill unblock wifi +fi + +if grep -q "Amsterdam" <<< "$TZDATA"; then + echo "Timezone properly configured" +else + timedatectl set-timezone Europe/Amsterdam +fi + + sed -i -e 's/dtoverlay=vc4-kms-v3d/dtoverlay=vc4-fkms-v3d/g' /boot/config.txt echo 'APT::Install-Recommends "false";' >> /etc/apt/apt.conf.d/01Recommends echo 'APT::Install-Suggests "false";' >> /etc/apt/apt.conf.d/01Suggests.