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
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
Ivan Tyagov
slapos.package
Commits
f09dd0e5
Commit
f09dd0e5
authored
Apr 25, 2023
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playbook/ors: improve configure-re6st script
parent
954aaacf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
17 deletions
+39
-17
playbook/roles/ors/files/configure-re6st
playbook/roles/ors/files/configure-re6st
+38
-16
playbook/roles/ors/files/configure-slapos.py
playbook/roles/ors/files/configure-slapos.py
+1
-1
No files found.
playbook/roles/ors/files/configure-re6st
View file @
f09dd0e5
#!/bin/bash
if
ip
-6
a show dev enp0s31f6 |
grep
-q
fe80
;
then
IFACE
=
"enp0s31f6"
elif
ip
-6
a show dev enp2s0 |
grep
-q
fe80
;
then
IFACE
=
"enp2s0"
else
exit
;
fi
IF_LIST
=()
RM_IF_LIST
=()
CONF
=
"/etc/re6stnet/re6stnet.conf"
sed
-i
'/^interface/d'
$CONF
# Don't run re6st with interface option at Lille Office
if
ping6
-q
-c2
-w3
fe80::20d:b9ff:fe3f:9055%
$IFACE
;
then
if
ps
-ax
-o
cmd |
grep
babeld |
grep
-q
$IFACE
;
then
systemctl restart re6stnet
;
TMP
=
"/tmp/re6stnet.conf.
$(
date
+%s
)
"
cd
/sys/class/net
;
for
IF
in
$(
find
.
-type
l
-printf
"%f
\n
"
)
;
do
# If interface is virtual
if
!
realpath
$(
readlink
$IF
)
|
grep
-q
"^/sys/devices/virtual"
;
then
# If interface is up and has IPv6 neighbours
if
[
"
$(
cat
$IF
/operstate
)
"
=
"up"
]
&&
[
-n
"
$(
ip
-6
neigh list dev
$IF
)
"
]
;
then
# Special case: interfaces connected to Lille office LAN should not have interface option enabled
if
!
ping6
-q
-c3
-w3
fe80::20d:b9ff:fe3f:9055%
$IF
;
then
IF_LIST+
=(
$IF
)
;
else
RM_IF_LIST+
=(
$IF
)
;
fi
fi
fi
done
cp
$CONF
$TMP
;
REPLACE
=
0
# Check if configuration is correct
for
IF
in
"
${
IF_LIST
[@]
}
"
;
do
if
!
grep
-q
"^interface
$IF
"
$TMP
;
then
REPLACE
=
1
fi
els
e
echo
"interface
$IFACE
"
>>
$CONF
if
!
ps
-ax
-o
cmd |
grep
babeld |
grep
-q
$IFACE
;
then
systemctl restart re6stnet
;
don
e
for
IF
in
"
${
RM_IF_LIST
[@]
}
"
;
do
if
grep
-q
"^interface
$IF
"
$TMP
;
then
REPLACE
=
1
fi
done
# Reconfigure re6st if configuration not correct
if
((
$REPLACE
))
;
then
sed
-i
'/^interface/d'
$TMP
for
IF
in
"
${
IF_LIST
[@]
}
"
;
do
echo
"interface
$IF
"
>>
$TMP
done
mv
$TMP
$CONF
;
systemctl restart re6stnet
fi
rm
-rf
$TMP
;
playbook/roles/ors/files/configure-slapos.py
View file @
f09dd0e5
...
...
@@ -43,6 +43,6 @@ with open('/opt/upgrader/configure-slapos.log', 'w+') as l:
l
.
write
(
"[configure-slapos] slapos.cfg not valid
\
n
"
)
# Delete slaptun devices
for
i
in
range
(
0
,
19
):
subprocess
.
run
([
'ip'
,
'link'
,
'delete'
,
'slaptun
'
])
subprocess
.
run
([
'ip'
,
'link'
,
'delete'
,
'slaptun
{}'
.
format
(
i
)
])
subprocess
.
run
([
'rm'
,
'-f'
,
'/opt/slapos/slapos.xml'
],
check
=
True
)
subprocess
.
run
([
'slapos'
,
'node'
,
'format'
,
'--now'
],
check
=
True
,
capture_output
=
True
)
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