Commit 570efe65 authored by Jean-Baptiste Petre's avatar Jean-Baptiste Petre

test jb re6stnet

parent 592c84b5
......@@ -211,8 +211,9 @@ def remove_former_scripts(slapos_configuration):
pass
_call(['rm','-f',os.path.join(slapos_configuration,'slapos')])
_call(['rm','-f','/etc/systemd/system/slapos.service'])
_call(['rm','-f','/etc/openvpn/vifib.conf'])
_call(['rm','-f','/etc/openvpn/client.conf'])
_call(['rm','-rf','/etc/openvpn/vifib-keys/'])
_call(['rm','-rf','/etc/openvpn/keys/'])
_call(['rm','-f',os.path.join(slapos_configuration,'run_slapformat')])
......@@ -360,13 +361,13 @@ def prepare_scripts (config):
os.chmod(path, 0755)
# add clientipv4
path = os.path.join('/','etc','openvpn','clientipv4.conf')
print "Creating %r" % path
if not dry_run:
open(path, 'w').write(
pkg_resources.resource_stream(__name__,
'template/%s' % 'clientipv4.conf.in').read())
os.chmod(path, 0755)
# path = os.path.join('/','etc','openvpn','clientipv4.conf')
# print "Creating %r" % path
# if not dry_run:
# open(path, 'w').write(
# pkg_resources.resource_stream(__name__,
# 'template/%s' % 'clientipv4.conf.in').read())
# os.chmod(path, 0755)
# Remove old-timers scripts
remove_former_scripts(slapos_configuration)
......@@ -438,7 +439,7 @@ class Config:
self.force_vpn = get_yes_no ("Do you want to use vpn to provide ipv6?",True)
self.force_slapcontainer = get_yes_no ("Do you want to force the use lxc on this computer?",False)
if self.force_vpn :
self.ipv6_interface = "tapVPN"
self.ipv6_interface = "lo"
else :
self.ipv6_interface = ""
self.need_ssh = get_yes_no("Do you want a remote ssh access?",True)
......
......@@ -38,7 +38,7 @@ done
IPV6CHECK=ipv6.google.com
IPV4CHECK=google.com
IPV6WAITTIME=5
SLAPVPN="ipv6_interface = tapVPN"
SLAPVPN="ipv6_interface = lo"
SLAPOS_CONFIGURATION='%(slapos_configuration)s'
......@@ -68,11 +68,12 @@ done
if [ $? != 0 ] || [ -f $SLAPOS_CONFIGURATION/openvpn-needed ]; then
echo """ Starting openVPN """
/etc/init.d/openvpn start
# /etc/init.d/openvpn start
service start re6stnet.service
sleep 10
ping6 -I tapVPN -c 2 $IPV6CHECK
ping6 -I lo -c 2 $IPV6CHECK
while [[ $? != 0 ]]; do
ping6 -I tapVPN -c 2 $IPV6CHECK
ping6 -I lo -c 2 $IPV6CHECK
done
# Ask slapos to use openvpn as ipv6 provider
sed -i "/${SLAPVPN}/ s/# *//" $SLAPOS_CONFIGURATION/slapos.cfg
......@@ -85,7 +86,6 @@ else
fi
# set random root password
pwgen -sync 512 1 | passwd --stdin root
......
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