mirror of
https://github.com/os-mnemo/pan-globalprotect-okta
synced 2026-07-31 15:54:36 +02:00
Make openconnect_args optional also in code.
This commit is contained in:
+2
-4
@@ -348,7 +348,7 @@ def main():
|
|||||||
cmd = conf.get('openconnect_cmd') or 'openconnect'
|
cmd = conf.get('openconnect_cmd') or 'openconnect'
|
||||||
cmd += ' --protocol=gp -u "{0}"'
|
cmd += ' --protocol=gp -u "{0}"'
|
||||||
cmd += ' --usergroup portal:portal-userauthcookie'
|
cmd += ' --usergroup portal:portal-userauthcookie'
|
||||||
cmd += ' --passwd-on-stdin ' + conf.get('openconnect_args') + ' "{1}"'
|
cmd += ' --passwd-on-stdin ' + conf.get('openconnect_args', '') + ' "{1}"'
|
||||||
cmd = cmd.format(saml_username, conf.get('vpn_url'))
|
cmd = cmd.format(saml_username, conf.get('vpn_url'))
|
||||||
gw = (conf.get('gateway') or '').strip()
|
gw = (conf.get('gateway') or '').strip()
|
||||||
nlbug = '\\n' if conf.get('bug.nl', '').lower() in ['1', 'true'] else ''
|
nlbug = '\\n' if conf.get('bug.nl', '').lower() in ['1', 'true'] else ''
|
||||||
@@ -363,10 +363,8 @@ 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 perform proper exit & cleanup
|
||||||
# Do not abort on SIGINT. openconnect will see it, and perform proper exit & cleanup
|
|
||||||
signal.signal(signal.SIGINT, signal.SIG_IGN)
|
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