commit fb536338aab0f7c400d1869f25e2cee4a319a19b parent e9215bf85d09963d8a1e56a928a7e54f77554441 Author: Nikos Mavrogiannopoulos <nmav@gnutls.org> Date: Mon, 1 Sep 2014 01:09:39 +0200 openconnect: openconnect-wrapper would trap signals and send the correct one to server Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org> Diffstat:
| M | net/openconnect/files/openconnect-wrapper | | | 19 | ++++++++++++++++++- |
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/net/openconnect/files/openconnect-wrapper b/net/openconnect/files/openconnect-wrapper @@ -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