From dfb3fa5a8829dba7e33fc5ca048680b6cfb057e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Schl=C3=BCter?= Date: Wed, 24 Jan 2018 14:27:16 +0100 Subject: itzks-installscrit: Add check to see if a WiFi-Interface is available before asking for SSID and PW. --- install-itzks-workstation | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/install-itzks-workstation b/install-itzks-workstation index 8f0dfd2..d8f1e53 100644 --- a/install-itzks-workstation +++ b/install-itzks-workstation @@ -31,19 +31,19 @@ invoke-rc.d fetch-ldap-cert start # Alternate add itzks-package repo only if not already there if [ -e /etc/apt/sources.list.d/itzks.list ] then - : + : else - touch /etc/apt/sources.list.d/itzks.list + touch /etc/apt/sources.list.d/itzks.list fi # Add repos to itzks.list if empty if [ -s /etc/apt/sources.list.d/itzks.list ] then - : + : else - echo "deb http://packages.it-zukunt-schule.de/debian stretch main contrib non-free" >> /etc/apt/sources.list.d/itzks.list - echo "deb http://packages.it-zukunft-schule.de/debian stretch-backports main contrib non-free" >> /etc/apt/sources.list.d/itzks.list - echo "deb http://packages.it-zukunft-schuke.de/debian sid main contrib non-free" >> /etc/apt/sources.list.d/itzks.list + echo "deb http://packages.it-zukunt-schule.de/debian stretch main contrib non-free" >> /etc/apt/sources.list.d/itzks.list + echo "deb http://packages.it-zukunft-schule.de/debian stretch-backports main contrib non-free" >> /etc/apt/sources.list.d/itzks.list + echo "deb http://packages.it-zukunft-schuke.de/debian sid main contrib non-free" >> /etc/apt/sources.list.d/itzks.list fi # Add itzks-package repo @@ -123,11 +123,28 @@ apt-get autoremove --purge gnome-packagekit #################### # Add system-wide WiFi-config -echo '! WIFI-Netzwerk hinzufügen' -read -p 'Wie lautet die SSID? ' ssid -read -p 'Wie lautet das zugehörige Passwort? ' passw -export WIFIDEV=wlan0 -wpa_passphrase $ssid $passw >> /etc/wpa_supplicant/wpa_supplicant-$WIFIDEV.conf +# echo '! WIFI-Netzwerk hinzufügen' +# read -p 'Wie lautet die SSID? ' ssid +# read -p 'Wie lautet das zugehörige Passwort? ' passw +# export WIFIDEV=wlan0 +# wpa_passphrase $ssid $passw >> /etc/wpa_supplicant/wpa_supplicant-$WIFIDEV.conf + +# Alternate: Check for WiFi-Interface before asking for SSID and PW + +FOUND=`grep "wlan0" /proc/net/dev` + +if [ -n "$FOUND" ] + then + # Add system-wide WiFi-config + echo '! WIFI-Netzwerk hinzufügen' + read -p 'Wie lautet die SSID? ' ssid + read -p 'Wie lautet das zugehörige Passwort? ' passw + export WIFIDEV=wlan0 + wpa_passphrase $ssid $passw >> /etc/wpa_supplicant/wpa_supplicant-$WIFIDEV.conf + else + : +fi + #################### -- cgit v1.2.3