diff --git a/usr/lib/archboot/installer/network.sh b/usr/lib/archboot/installer/network.sh index 5497445a9..5a02e8c9c 100644 --- a/usr/lib/archboot/installer/network.sh +++ b/usr/lib/archboot/installer/network.sh @@ -72,13 +72,10 @@ donetwork() { #shellcheck disable=SC2001,SC2086 WLAN_ESSID="$(echo ${WLAN_ESSID} | sed -e 's|#|\ |g')" while [[ ${WPA_AUTH} = "" ]]; do - DIALOG --inputbox "Enter your KEY (clear for open network):" 8 40 "WirelessKey" 2>"${ANSWER}" || return 1 + DIALOG --inputbox "Enter your KEY (clear/empty for open network):" 8 50 "SecretWirelessKey" 2>"${ANSWER}" || return 1 WLAN_KEY=$(cat "${ANSWER}") - if [[ -z "${WLAN_KEY}" ]]; then - WLAN_SECURITY="NONE" - else - WLAN_SECURITY="WPA-PSK" - fi + WLAN_SECURITY="WPA-PSK" + [[ -z "${WLAN_KEY}" ]] && WLAN_SECURITY="NONE" # setup wpa_supplicant WPA_PROFILE="/etc/wpa_supplicant/wpa_supplicant-${INTERFACE}.conf" echo "#$NETWORK_PROFILE generated by archboot setup" > "${WPA_PROFILE}" @@ -93,9 +90,9 @@ donetwork() { #shellcheck disable=2086 systemctl restart wpa_supplicant@${INTERFACE}.service AUTH_COUNT="0" + DIALOG --infobox "Waiting 30 seconds for authentification ..." 3 60 #shellcheck disable=2086 while ! systemctl status wpa_supplicant@${INTERFACE}.service | grep -qw CTRL-EVENT-CONNECTED > /dev/null 2>&1; do - DIALOG --infobox "Waiting 30 seconds for authentification ..." 3 60 sleep 1 AUTH_COUNT="$((AUTH_COUNT+1))" systemctl status wpa_supplicant@${INTERFACE}.service | grep -qw CTRL-EVENT-DISCONNECTED > /dev/null 2&>1 && break @@ -171,9 +168,9 @@ donetwork() { fi echo "Using setup's network profile ${NETWORK_PROFILE} now..." > "${LOG}" systemctl restart systemd-networkd - # add sleep here dhcp can need some time to get link - DIALOG --infobox "Waiting 30 seconds for network link to come up ..." 3 60 NETWORK_COUNT="0" + DIALOG --infobox "Waiting 30 seconds for network link to come up ..." 3 60 + # add sleep here dhcp can need some time to get link while ! ping -c1 www.google.com > "${LOG}" 2>&1; do sleep 1 NETWORK_COUNT="$((NETWORK_COUNT+1))"