remove wpa_supplicant code

This commit is contained in:
Tobias Powalowski 2022-12-10 09:41:37 +01:00
parent f394c604c7
commit 7366648fe6

View file

@ -16,7 +16,7 @@ essid_scan() {
iwctl station "${INTERFACE}" scan iwctl station "${INTERFACE}" scan
# only show lines with signal '*' # only show lines with signal '*'
# kill spaces from the end # kill spaces from the end
for dev in $(iwctl station "${INTERFACE}" get-networks | grep '*' | cut -c 11-44 | sed -e 's#\ $##g'); do for dev in $(iwctl station "${INTERFACE}" get-networks | grep '\*' | cut -c 11-44 | sed -e 's#\ $##g'); do
echo "${dev}" echo "${dev}"
[[ "${1}" ]] && echo "${1}" [[ "${1}" ]] && echo "${1}"
done done
@ -43,56 +43,25 @@ do_wireless() {
fi fi
#shellcheck disable=SC2001,SC2086 #shellcheck disable=SC2001,SC2086
while [[ -z "${WPA_AUTH}" ]]; do while [[ -z "${WPA_AUTH}" ]]; do
# expect hidden network has a WLAN_KEY # expect hidden network has a WLAN_KEY
if ! [[ "$(iwctl station "${INTERFACE}" get-networks | grep -w "${WLAN_ESSID}" | cut -c 45-49 | grep -q 'open')" || "${WLAN_HIDDEN}" == "yes" ]]; then #shellcheck disable=SC2143
DIALOG --inputbox "Enter your KEY:" 8 50 "SecretWirelessKey" 2>"${ANSWER}" || return 1 if ! [[ "$(iwctl station "${INTERFACE}" get-networks | grep -w "${WLAN_ESSID}" | cut -c 45-49 | grep -q 'open')" || "${WLAN_HIDDEN}" == "yes" ]]; then
WLAN_KEY=$(cat "${ANSWER}") DIALOG --inputbox "Enter your KEY:" 8 50 "SecretWirelessKey" 2>"${ANSWER}" || return 1
fi WLAN_KEY=$(cat "${ANSWER}")
# time to connect fi
if [[ -z "${WLAN_KEY}" ]]; then # time to connect
iwctl station "${INTERFACE}" connect "${WLAN_ESSID}" && WPA_AUTH="1" if [[ -z "${WLAN_KEY}" ]]; then
else iwctl station "${INTERFACE}" connect "${WLAN_ESSID}" && WPA_AUTH="1"
iwctl --passphrase="${WLAN_KEY}" station "${INTERFACE}" connect "${WLAN_ESSID}" && WPA_AUTH="1" else
fi iwctl --passphrase="${WLAN_KEY}" station "${INTERFACE}" connect "${WLAN_ESSID}" && WPA_AUTH="1"
if [[ "${WPA_AUTH}" == "1" ]]; then fi
DIALOG --infobox "Authentification successfull. Continuing in 3 seconds ..." 3 70 if [[ "${WPA_AUTH}" == "1" ]]; then
sleep 3 DIALOG --infobox "Authentification successfull. Continuing in 3 seconds ..." 3 70
else sleep 3
DIALOG --msgbox "Error:\nAuthentification failed. Please configure again!" 6 60 else
fi DIALOG --msgbox "Error:\nAuthentification failed. Please configure again!" 6 60
# setup wpa_supplicant fi
#WPA_PROFILE="/etc/wpa_supplicant/wpa_supplicant-${INTERFACE}.conf" done
#echo "#$NETWORK_PROFILE generated by archboot setup" > "${WPA_PROFILE}"
#echo "network={" >> "${WPA_PROFILE}"
#[[ "${WLAN_HIDDEN}" == "yes" ]] && echo "scan_ssid=1" >> "${WPA_PROFILE}"
#echo "key_mgmt=${WLAN_SECURITY}" >> "${WPA_PROFILE}"
#echo "ssid=\"${WLAN_ESSID}\"" >> "${WPA_PROFILE}"
#[[ -z "${WLAN_KEY}" ]] || echo "psk=\"${WLAN_KEY}\"" >> "${WPA_PROFILE}"
#echo "}" >> "${WPA_PROFILE}"
#echo "wpa_supplicant config saved to ${WPA_PROFILE}." > "${LOG}"
#echo "Starting wpa_supplicant@${INTERFACE} ..." > "${LOG}"
#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} | grep -qw "CTRL-EVENT-CONNECTED"; do
# sleep 1
# AUTH_COUNT="$((AUTH_COUNT+1))"
# systemctl status wpa_supplicant@${INTERFACE} | grep -qw "CTRL-EVENT-DISCONNECTED" && break
# [[ "${AUTH_COUNT}" == "30" ]] && break
#done
#shellcheck disable=2086
#if systemctl status wpa_supplicant@${INTERFACE} | grep -qw "CTRL-EVENT-CONNECTED"; then
# WPA_AUTH="1"
# echo "wpa_supplicant@${INTERFACE}" > /tmp/.wpa_supplicant
# DIALOG --infobox "Authentification successfull. Continuing in 3 seconds ..." 3 70
# sleep 3
#else
# DIALOG --msgbox "Error:\nAuthentification failed. Please configure again!" 6 60
# WPA_AUTH=""
#fi
#done
fi fi
} }