Commit c180e126 authored by Guillaume Bury's avatar Guillaume Bury

To fix : Environment (external_ip) not set yet when executing ipchange

parent 39926c6c
#!/usr/bin/python -S #!/usr/bin/python -S
import os, sys import os, time, sys
# example of os.environ # example of os.environ
{'X509_0_C': 'FR', {'X509_0_C': 'FR',
...@@ -38,7 +38,9 @@ import os, sys ...@@ -38,7 +38,9 @@ import os, sys
'verb': '3'} 'verb': '3'}
# Send to client his external ip address # Send to client his external ip address
open(sys.argv[2], 'w').write('push "setenv external_ip %s"\n' % os.environ['trusted_ip']) if os.environ['script_type'] == 'client-connect':
with open(sys.argv[2], 'w') as f:
f.write('push "setenv external_ip %s"\n' % os.environ['trusted_ip'])
# Write into pipe connect/disconnect events # Write into pipe connect/disconnect events
os.write(int(sys.argv[1]), '%(script_type)s %(common_name)s\n' % os.environ) os.write(int(sys.argv[1]), '%(script_type)s %(common_name)s\n' % os.environ)
#!/usr/bin/python -S #!/usr/bin/python -S
import os, sys import os, time, sys
# Write into pipe external ip address received # Write into pipe external ip address received
os.write(int(sys.argv[1]), '%(script_type)s %(external_ip)s\n' % os.environ) # Pb: executed before ( or at the same time ) as client-connect on server
# \===> external_ip not set when script is launched
# os.write(int(sys.argv[1]), '%(script_type)s %(external_ip)s\n' % os.environ)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment