openconnect: openconnect-wrapper would trap signals and send the correct one to server
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
This commit is contained in:
parent
e9215bf85d
commit
fb536338aa
1 changed files with 18 additions and 1 deletions
|
@ -11,4 +11,21 @@ test -z "$1" && exit 1
|
||||||
pwfile=$1
|
pwfile=$1
|
||||||
shift
|
shift
|
||||||
|
|
||||||
cat $pwfile|/usr/sbin/openconnect $*
|
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
|
||||||
|
|
Loading…
Reference in a new issue