Commit bcf3c298 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

OpenVPN added to image

On boot, slapos script check for Ipv6. If none is found it launch and use OpenVPN
parent 23d01bb6
......@@ -358,5 +358,3 @@ def main():
sys.exit(return_code)
if __name__ == "__main__":
main()
......@@ -50,6 +50,11 @@ if [ -f /etc/init.d/suse_studio_firstboot ]
then
echo "______________Init of SlapOS service_______________"
/etc/init.d/slapos_firstboot
#By default openvpn is running, we disable this feature
/etc/init.d/openvpn stop
chkconfig --del openvpn
mv /etc/slapos/slapos.service /etc/systemd/system/
systemctl enable slapos.service
systemctl start slapos.service
......
......@@ -33,6 +33,30 @@ for service in rpcbind network-remotefs postfix ; do
/etc/init.d/$service stop
done
# Test ipv6 connectivity and if not working use openvpn
# and wait for it to be ready
/etc/init.d/openvpn stop
ping6 -c 2 ipv6.google.com
if [[ $? != 0 ]]; then
echo """ Starting openVPN """
/etc/init.d/openvpn start
ping6 -c 2 ipv6.google.com
while [[ $? != 0 ]]; do
ping6 -c 2 ipv6.google.com
done
# Ask slapos to use openvpn as ipv6 provider
if [ ! -f /etc/slapos/openvpn-needed ]; then
touch /etc/slapos/openvpn-needed
echo "ipv6_interface = tapVPN" >> /etc/slapos/slapos.cfg
fi
else
# OpenVPN not needed delete last line of slapos.cfg if OpenVPN has been used before
if [ -f /etc/slapos/openvpn-needed ]; then
rm /etc/slapos/openvpn-needed
sed -i '$d' /etc/slapos/slapos.cfg
fi
fi
# set random root password
pwgen -sync 512 1 | passwd --stdin root
......@@ -101,5 +125,4 @@ chmod 666 /dev/kvm
disk=`blkid -L SLAPOS | sed -r -e 's/(\/dev\/|[0-9]*$)//g'`
echo noop > /sys/block/$disk/queue/scheduler
;;
esac
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