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

test jb re6stnet

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