Skip to content
Snippets Groups Projects
Commit 1460d982 authored by Jouke Witteveen's avatar Jouke Witteveen
Browse files

Catch connection failures from wifi-menu

Wireless connections yield before the password is checked, so it is
better to wait for a connection to come online before concluding the
generated profile works.
parent 2f1a0d11
No related branches found
No related tags found
No related merge requests found
......@@ -129,10 +129,13 @@ unit_reenable() {
wait_online() {
local profile="$1"
if sd_call "is-active --quiet" "$profile"; then
timeout_wait "${TIMEOUT_ONLINE:-120}" \
'[[ $(sd_status_text "$profile") == "online" ]]'
else
if ! timeout_wait "${TIMEOUT_ONLINE:-120}" \
'! sd_call "is-active --quiet" "$profile" || \
[[ $(sd_status_text "$profile") == "online" ]]'; then
report_notice "timeout"
return 1
elif ! sd_call "is-active --quiet" "$profile"; then
report_notice "failed"
return 1
fi
}
......
......@@ -196,7 +196,7 @@ connect_to_ssid() {
do_debug systemctl restart "netctl-auto@$INTERFACE.service"
fi
do_debug netctl-auto switch-to "$PROFILE"
elif ! netctl switch-to "$PROFILE"; then
elif ! netctl switch-to "$PROFILE" || ! netctl wait-online "$PROFILE"; then
if is_yes "${NEW_PROFILE:-no}"; then
msg=" CONNECTING FAILED
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment