20 lines
467 B
Bash
Executable File
20 lines
467 B
Bash
Executable File
#!/bin/bash
|
|
action="$1"
|
|
shift
|
|
case "$action" in
|
|
"connect")
|
|
ncat -l 1236 -k -e /app/healthz.sh &
|
|
echo "Waiting for cookie on tcp:1235..."
|
|
cookie="$(ncat -l 1235)"
|
|
echo "Got cookie! Connecting..."
|
|
exec openconnect --script-tun --script "/app/tcpproxy -g -L 1234:$HOST" --non-inter --cookie="$cookie" --disable-ipv6 "$@"
|
|
;;
|
|
"authenticate")
|
|
exec openconnect --cookieonly "$@"
|
|
;;
|
|
*)
|
|
echo "Unknown action $action"
|
|
exit 1
|
|
;;
|
|
esac
|