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
6bb5d03f
Commit
6bb5d03f
authored
Sep 06, 2024
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playbook/ors: fix configure-re6st script (add interface option)
parent
1c75b1e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
21 deletions
+9
-21
playbook/roles/ors/files/configure-re6st
playbook/roles/ors/files/configure-re6st
+9
-21
No files found.
playbook/roles/ors/files/configure-re6st
View file @
6bb5d03f
#!/bin/bash
#!/bin/bash
IF_LIST
=()
RM_IF_LIST
=()
CONF
=
"/etc/re6stnet/re6stnet.conf"
CONF
=
"/etc/re6stnet/re6stnet.conf"
TMP
=
"/tmp/re6stnet.conf.
$(
date
+%s
)
"
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
RM_IF_LIST+
=(
$IF
)
;
fi
fi
done
cp
$CONF
$TMP
;
REPLACE
=
0
REPLACE
=
0
# Check if configuration is correct
for
IF
in
"
${
IF_LIST
[@]
}
"
;
do
cp
$CONF
$TMP
;
for
IF
in
$(
ls
-1
/sys/class/net/ |
grep
-v
"^lo
\|
^re6stnet
\|
^slap"
)
;
do
if
!
grep
-q
"^interface
$IF
"
$TMP
;
then
if
!
grep
-q
"^interface
$IF
"
$TMP
;
then
REPLACE
=
1
REPLACE
=
1
fi
fi
done
done
for
IF
in
"
${
RM_IF_LIST
[@]
}
"
;
do
if
grep
-q
"^interface
$IF
"
$TMP
;
then
echo
$REPLACE
REPLACE
=
1
fi
done
# Reconfigure re6st if configuration not correct
# Reconfigure re6st if configuration not correct
if
((
$REPLACE
))
;
then
if
((
$REPLACE
))
;
then
sed
-i
'/^interface/d'
$TMP
sed
-i
'/^interface/d'
$TMP
for
IF
in
"
${
IF_LIST
[@]
}
"
;
do
for
IF
in
$(
ls
-1
/sys/class/net/ |
grep
-v
"^lo
\|
^re6stnet
\|
^slap"
)
;
do
echo
"interface
$IF
"
>>
$TMP
echo
"interface
$IF
"
>>
$TMP
done
done
mv
$TMP
$CONF
;
mv
$TMP
$CONF
;
...
...
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