openconnect: fix token_script error handling/logging

When token_script fails, proto_setup_failed() notifies netifd that
setup has failed, but script execution continues regardless.
This commit adds exit 1 and sleep 5 (consistent with wireguard.sh
error handling) to abort setup on token_script failure. Also fix
typo in logger tag ("openconenct" -> "openconnect").

Signed-off-by: Thomas Winkler <tewinkler86@gmail.com>
This commit is contained in:
Thomas Winkler
2026-03-10 13:40:28 +01:00
committed by Nikos Mavrogiannopoulos
parent 638335582a
commit 15500a07f8

View File

@@ -149,8 +149,10 @@ proto_openconnect_setup() {
}
[ "$token_mode" = "script" ] && {
$token_script >> "$pwfile" 2> /dev/null || {
logger -t openconenct "Cannot get password from script '$token_script'"
logger -t openconnect "Cannot get password from script '$token_script'"
sleep 5
proto_setup_failed "$config"
exit 1
}
}
append_args --passwd-on-stdin