Fix cistech-tunnel: restore echo pipe in elif branch
Some checks failed
Test / test (push) Has been cancelled

The elif branch was missing 'echo "" |' which caused openconnect-sso
to hang waiting for stdin input when OC_PASSWORD is not set.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-17 10:20:24 +00:00
parent 498926ae5d
commit ec40aa2ec1

View File

@@ -96,8 +96,14 @@ ENVFILE
source /etc/vpn.env source /etc/vpn.env
echo "[$(date)] Starting VPN connection..." echo "[$(date)] Starting VPN connection..."
# Set password for openconnect
export OPENCONNECT_PASSWORD="$OC_PASSWORD"
# openconnect-sso reads TOTP from keyring automatically # openconnect-sso reads TOTP from keyring automatically
if [[ -n "$OC_USER" ]]; then # Pass password via stdin for SSO form if needed
if [[ -n "$OC_USER" && -n "$OC_PASSWORD" ]]; then
echo "$OC_PASSWORD" | openconnect-sso -s "$OC_URL" ${OC_SSO_ARGS:-$OC_SSO_ARGS_DEFAULT} -- $OPENCONNECT_CMD
elif [[ -n "$OC_USER" ]]; then
echo "" | openconnect-sso -s "$OC_URL" ${OC_SSO_ARGS:-$OC_SSO_ARGS_DEFAULT} -- $OPENCONNECT_CMD echo "" | openconnect-sso -s "$OC_URL" ${OC_SSO_ARGS:-$OC_SSO_ARGS_DEFAULT} -- $OPENCONNECT_CMD
else else
openconnect-sso -s "$OC_URL" ${OC_SSO_ARGS:-$OC_SSO_ARGS_DEFAULT} -- $OPENCONNECT_CMD openconnect-sso -s "$OC_URL" ${OC_SSO_ARGS:-$OC_SSO_ARGS_DEFAULT} -- $OPENCONNECT_CMD