You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

31 lines
393 B

#!/bin/sh
# This script wraps openconnect in order to obtain the password
# file from cmd.
# $1 password file
# $2... are passed to openconnect
test -z "$1" && exit 1
pwfile=$1
shift
pidfile=/var/run/ocwrap-$$.pid
cleanup()
{
if ! test -z "$pid";then
kill $pid
wait $pid
fi
exit 0
}
trap cleanup 1 2 3 6 15
rm -f "$pidfile"
/usr/sbin/openconnect $* <$pwfile &
pid=$!
wait $pid