I am attempting to start openconnect
via a Debian init script that makes use of start-stop-daemon
:
DAEMON=/usr/sbin/openconnect
DAEMON_ARGS="<endpoint> --script /etc/vpnc/vpnc-script --user <user> --pid-file $PIDFILE --passwd-on-stdin"
PASSWORD=`cat /etc/openconnect/<endpoint>.passwd`
start-stop-daemon --start --pidfile "$PIDFILE" --exec "$DAEMON" -- $DAEMON_ARGS <<< ${PASSWORD}
Unfortunately, openconnect still prompts for a password during startup as it does not seem to be able to read the password redirected to stdin.
Any ideas?