Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
re6stnet
Commits
c180e126
Commit
c180e126
authored
Jul 16, 2012
by
Guillaume Bury
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
To fix : Environment (external_ip) not set yet when executing ipchange
parent
39926c6c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
client-connect
client-connect
+4
-2
ipchange
ipchange
+5
-2
No files found.
client-connect
View file @
c180e126
#!/usr/bin/python -S
import
os
,
sys
import
os
,
time
,
sys
# example of os.environ
{
'X509_0_C'
:
'FR'
,
...
...
@@ -38,7 +38,9 @@ import os, sys
'verb'
:
'3'
}
# 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
os
.
write
(
int
(
sys
.
argv
[
1
]),
'%(script_type)s %(common_name)s
\
n
'
%
os
.
environ
)
ipchange
View file @
c180e126
#!/usr/bin/python -S
import
os
,
sys
import
os
,
time
,
sys
# 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)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment