diff options
author | Benjamin Schlüter <bschlueter@posteo.de> | 2018-01-26 15:41:30 +0100 |
---|---|---|
committer | Benjamin Schlüter <bschlueter@posteo.de> | 2018-01-26 15:41:30 +0100 |
commit | a935f6e810be3ddc704dc3a5d4afa59a40a977f1 (patch) | |
tree | 238ae88a7a5cd594432b27d291228304c57b30a9 | |
parent | aa7da666bbface39992097e1806df56b42a01913 (diff) | |
download | itzks-install-script-a935f6e810be3ddc704dc3a5d4afa59a40a977f1.tar.gz itzks-install-script-a935f6e810be3ddc704dc3a5d4afa59a40a977f1.tar.bz2 itzks-install-script-a935f6e810be3ddc704dc3a5d4afa59a40a977f1.zip |
Change script to work with NetworkManager instead of systemd-networkd.
-rw-r--r-- | install-itzks-workstation | 71 |
1 files changed, 60 insertions, 11 deletions
diff --git a/install-itzks-workstation b/install-itzks-workstation index 82bb872..d171b56 100644 --- a/install-itzks-workstation +++ b/install-itzks-workstation @@ -98,18 +98,67 @@ editor /etc/default/nfs-common # Alternate: Check for WiFi-Interface before asking for SSID and PW -FOUND=`iwconfig | grep "IEE 802.11"` -WIFIDEV=$(echo "$FOUND" | awk '{print $1}') +#FOUND=`iwconfig | grep "IEE 802.11"` +#WIFIDEV=$(echo "$FOUND" | awk '{print $1}') # FIXME: this works for systemd-networkd, but not for NetworkManager -if [ -n "$FOUND" ]; then - export WIFIDEV - # 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 - wpa_passphrase $ssid $passw >> /etc/wpa_supplicant/wpa_supplicant-$WIFIDEV.conf -fi +#if [ -n "$FOUND" ]; then +# export WIFIDEV +# # 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 +# wpa_passphrase $ssid $passw >> /etc/wpa_supplicant/wpa_supplicant-$WIFIDEV.conf +#fi + +# Alternate WiFi-config for NetworkManager + +# Write standard config +touch /etc/NetworkManager/system-connections/BLANK +cat <<EOT >> /etc/NetworkManager/system-connections/BLANK +[connection] +id=<SSID> +uuid=42d084e4-4ff0-45a0-8aee-771c7a568046 +type=wifi +permissions= +timestamp=1515144490 +autoconnect=true + +[wifi] +mac-address-blacklist= +mode=infrastructure +ssid=<SSID> + +[wifi-security] +key-mgmt=wpa-psk +psk=<password> + +[ipv4] +dns-search= +method=auto +ignore-auto-routes=false +ignore-auto-dns=false +never-default=false + +[ipv6] +method=ignore +EOT + +# Generate uuid and timestamp and overwrite in file + +UUID=$(uuidgen -t wlan0) +sed -i 's/uuid=.*/uuid='"$UUID"'/' /etc/NetworkManager/system-connections/BLANK + +TIMESTAMP=$(date +%s ) +sed -i 's/timestamp=.*/timestamp='"$TIMESTAMP"'/' /etc/NetworkManager/system-connections/BLANK + +# Ask user for SSID and password +echo '! WIFI-Netzwerk hinzufügen' +read -p 'Wie lautet die SSID? ' ssid +sed -i 's/ssid=.*/ssid='"$ssid"'/' /etc/NetworkManager/system-connections/BLANK +read -p 'Wie lautet das zugehörige Passwort? ' passw +sed -i 's/psk=.*/psk='"$passw"'/' /etc/NetworkManager/system-connections/BLANK +mv /etc/NetworkManager/systems-connections/BLANK /etc/NetworkManager/systems-connections/"$ssid" #################### @@ -145,4 +194,4 @@ echo '''! FERTIG Die Installation - des Basissystems mit ITZKS-Anpassungen - des Puppet-Agents -ist abgeschlossen.''' +ist abgeschlossen.'''
\ No newline at end of file |