Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Douglas
slapos.package
Commits
570efe65
Commit
570efe65
authored
Nov 22, 2012
by
Jean-Baptiste Petre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test jb re6stnet
parent
592c84b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
15 deletions
+16
-15
slapprepare/slapprepare/__init__.py
slapprepare/slapprepare/__init__.py
+11
-10
slapprepare/slapprepare/script/slapos
slapprepare/slapprepare/script/slapos
+5
-5
No files found.
slapprepare/slapprepare/__init__.py
View file @
570efe65
...
...
@@ -211,11 +211,12 @@ 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'
)])
# Specific function to configure SlapOS Image
def
slapserver
(
config
):
...
...
@@ -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
)
...
...
slapprepare/slapprepare/script/slapos
100755 → 100644
View file @
570efe65
...
...
@@ -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
...
...
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