mirror of
https://github.com/os-mnemo/pan-globalprotect-okta
synced 2026-07-31 15:54:36 +02:00
Ignore SIGINT to allow proper cleanup on Ctrl-C
This commit is contained in:
+5
-1
@@ -24,7 +24,7 @@
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import io, os, sys, re, json, base64, getpass, subprocess, shlex
|
import io, os, sys, re, json, base64, getpass, subprocess, shlex, signal
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
@@ -363,6 +363,10 @@ def main():
|
|||||||
pp = subprocess.Popen(shlex.split(pcmd), stdout=subprocess.PIPE)
|
pp = subprocess.Popen(shlex.split(pcmd), stdout=subprocess.PIPE)
|
||||||
cp = subprocess.Popen(cmd, stdin=pp.stdout, stdout=sys.stdout)
|
cp = subprocess.Popen(cmd, stdin=pp.stdout, stdout=sys.stdout)
|
||||||
pp.stdout.close()
|
pp.stdout.close()
|
||||||
|
|
||||||
|
# Do not abort on SIGINT. openconnect will see it, and perform proper exit & cleanup
|
||||||
|
signal.signal(signal.SIGINT, signal.SIG_IGN)
|
||||||
|
|
||||||
cp.communicate()
|
cp.communicate()
|
||||||
else:
|
else:
|
||||||
print('{0} | {1}'.format(pcmd, cmd))
|
print('{0} | {1}'.format(pcmd, cmd))
|
||||||
|
|||||||
Reference in New Issue
Block a user