Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
slapos.toolbox
Commits
6d30111a
Commit
6d30111a
authored
Apr 11, 2012
by
Cédric Le Ninivin
Committed by
Cédric de Saint Martin
Apr 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added connectivity check before launching slapformat
parent
4d20ed03
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
slapos/builder/script/slapos
slapos/builder/script/slapos
+22
-2
No files found.
slapos/builder/script/slapos
View file @
6d30111a
...
@@ -34,11 +34,31 @@ for service in rpcbind network-remotefs postfix ; do
...
@@ -34,11 +34,31 @@ for service in rpcbind network-remotefs postfix ; do
done
done
IPV6CHECK
=
ipv6.google.com
IPV6CHECK
=
ipv6.google.com
IPV4CHECK
=
google.com
IPV6WAITTIME
=
5
# Test ipv6 connectivity and if not working use openvpn
# Test ipv
4/ipv
6 connectivity and if not working use openvpn
# and wait for it to be ready
# and wait for it to be ready
/etc/init.d/openvpn stop
/etc/init.d/openvpn stop
ping
-c
2
$IPV4CHECK
while
[
$?
!=
0
]
;
do
sleep
5
ping
-c
2
$IPV4CHECK
done
echo
"""Ipv4 connection ok"""
# Wait for native ipv6 connection to be ready
i
=
0
ping6
-c
2
$IPV6CHECK
ping6
-c
2
$IPV6CHECK
while
[[
$?
!=
0
]]
&&
[[
$i
<
$IPV6WAITTIME
]]
do
let
i++
sleep
1
ping6
-c
2
$IPV6CHECK
done
if
[[
$?
!=
0
]]
;
then
if
[[
$?
!=
0
]]
;
then
echo
""" Starting openVPN """
echo
""" Starting openVPN """
/etc/init.d/openvpn start
/etc/init.d/openvpn start
...
@@ -46,7 +66,7 @@ if [[ $? != 0 ]]; then
...
@@ -46,7 +66,7 @@ if [[ $? != 0 ]]; then
while
[[
$?
!=
0
]]
;
do
while
[[
$?
!=
0
]]
;
do
ping6
-c
2
$IPV6CHECK
ping6
-c
2
$IPV6CHECK
done
done
# Ask slapos to use openvpn as ipv6 provider
# Ask slapos to use openvpn as ipv6 provider
if
[
!
-f
/etc/slapos/openvpn-needed
]
;
then
if
[
!
-f
/etc/slapos/openvpn-needed
]
;
then
touch
/etc/slapos/openvpn-needed
touch
/etc/slapos/openvpn-needed
echo
"ipv6_interface = tapVPN"
>>
/etc/slapos/slapos.cfg
echo
"ipv6_interface = tapVPN"
>>
/etc/slapos/slapos.cfg
...
...
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