Browse Source

openconnect: openconnect-wrapper would trap signals and send the correct one to server

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
lilik-openwrt-22.03
Nikos Mavrogiannopoulos 10 years ago
parent
commit
fb536338aa
1 changed files with 18 additions and 1 deletions
  1. +18
    -1
      net/openconnect/files/openconnect-wrapper

+ 18
- 1
net/openconnect/files/openconnect-wrapper View File

@ -11,4 +11,21 @@ test -z "$1" && exit 1
pwfile=$1
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…
Cancel
Save