mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
remove wpa_supplicant code
This commit is contained in:
parent
f394c604c7
commit
7366648fe6
1 changed files with 20 additions and 51 deletions
|
@ -16,7 +16,7 @@ essid_scan() {
|
|||
iwctl station "${INTERFACE}" scan
|
||||
# only show lines with signal '*'
|
||||
# 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}"
|
||||
[[ "${1}" ]] && echo "${1}"
|
||||
done
|
||||
|
@ -43,56 +43,25 @@ do_wireless() {
|
|||
fi
|
||||
#shellcheck disable=SC2001,SC2086
|
||||
while [[ -z "${WPA_AUTH}" ]]; do
|
||||
# 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
|
||||
DIALOG --inputbox "Enter your KEY:" 8 50 "SecretWirelessKey" 2>"${ANSWER}" || return 1
|
||||
WLAN_KEY=$(cat "${ANSWER}")
|
||||
fi
|
||||
# time to connect
|
||||
if [[ -z "${WLAN_KEY}" ]]; then
|
||||
iwctl station "${INTERFACE}" connect "${WLAN_ESSID}" && WPA_AUTH="1"
|
||||
else
|
||||
iwctl --passphrase="${WLAN_KEY}" station "${INTERFACE}" connect "${WLAN_ESSID}" && WPA_AUTH="1"
|
||||
fi
|
||||
if [[ "${WPA_AUTH}" == "1" ]]; then
|
||||
DIALOG --infobox "Authentification successfull. Continuing in 3 seconds ..." 3 70
|
||||
sleep 3
|
||||
else
|
||||
DIALOG --msgbox "Error:\nAuthentification failed. Please configure again!" 6 60
|
||||
fi
|
||||
# setup wpa_supplicant
|
||||
#WPA_PROFILE="/etc/wpa_supplicant/wpa_supplicant-${INTERFACE}.conf"
|
||||
#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
|
||||
# expect hidden network has a WLAN_KEY
|
||||
#shellcheck disable=SC2143
|
||||
if ! [[ "$(iwctl station "${INTERFACE}" get-networks | grep -w "${WLAN_ESSID}" | cut -c 45-49 | grep -q 'open')" || "${WLAN_HIDDEN}" == "yes" ]]; then
|
||||
DIALOG --inputbox "Enter your KEY:" 8 50 "SecretWirelessKey" 2>"${ANSWER}" || return 1
|
||||
WLAN_KEY=$(cat "${ANSWER}")
|
||||
fi
|
||||
# time to connect
|
||||
if [[ -z "${WLAN_KEY}" ]]; then
|
||||
iwctl station "${INTERFACE}" connect "${WLAN_ESSID}" && WPA_AUTH="1"
|
||||
else
|
||||
iwctl --passphrase="${WLAN_KEY}" station "${INTERFACE}" connect "${WLAN_ESSID}" && WPA_AUTH="1"
|
||||
fi
|
||||
if [[ "${WPA_AUTH}" == "1" ]]; then
|
||||
DIALOG --infobox "Authentification successfull. Continuing in 3 seconds ..." 3 70
|
||||
sleep 3
|
||||
else
|
||||
DIALOG --msgbox "Error:\nAuthentification failed. Please configure again!" 6 60
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue