Commit 296762dd authored by Julien Muchembled's avatar Julien Muchembled

Revert "Remove old fix in ovpn-client"

This reverts commit 24fea8cd.

The client up hook is required when IPv4 is not enabled.
parents 12ba2ee4 114a1763
#!/usr/bin/python2 -S #!/usr/bin/python2 -S
import os, sys, time import os, sys
os.write(int(sys.argv[1]), repr((os.environ['common_name'], time.time(),
int(os.environ['tls_serial_0']), os.environ['OPENVPN_external_ip']))) script_type = os.environ['script_type']
if script_type == 'up':
# OpenVPN only brings the interface up when it's called with --ifconfig
# i.e. when IPv4 mode is enabled in re6st.
# OpenVPN unsets PATH before calling hooks
# which is equivalent to set /bin:/usr/bin
os.environ['PATH'] = '/bin:/sbin:/usr/bin:/usr/sbin'
os.execlp('ip', 'ip', 'link', 'set', os.environ['dev'], 'up',
'mtu', os.environ['tun_mtu'])
if script_type == 'route-up':
import time
os.write(int(sys.argv[1]), repr((os.environ['common_name'], time.time(),
int(os.environ['tls_serial_0']), os.environ['OPENVPN_external_ip'])))
...@@ -13,6 +13,7 @@ def openvpn(iface, encrypt, *args, **kw): ...@@ -13,6 +13,7 @@ def openvpn(iface, encrypt, *args, **kw):
'--persist-tun', '--persist-tun',
'--persist-key', '--persist-key',
'--script-security', '2', '--script-security', '2',
'--up', ovpn_client,
#'--user', 'nobody', '--group', 'nogroup', #'--user', 'nobody', '--group', 'nogroup',
] + list(args) ] + list(args)
if ovpn_log: if ovpn_log:
......
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