Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
FFS Gluon Packages
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
firmware
FFS Gluon Packages
Commits
414ba45e
Commit
414ba45e
authored
Jun 11, 2017
by
ffs-Monitor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimized script an make it more robust.
parent
647d77b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
ffs-set-segment/files/usr/sbin/ffs-set-segment
ffs-set-segment/files/usr/sbin/ffs-set-segment
+5
-5
No files found.
ffs-set-segment/files/usr/sbin/ffs-set-segment
View file @
414ba45e
#!/bin/sh
ME
=
$(
basename
$0
)
if
[
$(
ps |
grep
-c
"
{
$(
basename
$0
)
}
"
)
-gt
4
]
;
then
if
[
$(
ps |
grep
-c
"
$ME
"
)
-gt
4
]
;
then
logger
-s
-t
$ME
"started twice"
exit
1
fi
...
...
@@ -15,7 +15,7 @@ fi
NODEID
=
$(
uci get network.bat0.macaddr |
sed
's/://g'
)
PUBKEY
=
$(
/etc/init.d/fastd show_key mesh_vpn |
cut
-c1-12
)
SEGINFO
=
$(
nslookup ffs-
$
NODEID
-
$PUBKEY
.segassign.freifunk-stuttgart.de
[
::1]:54 |
grep
"2001:2:0:711::"
)
SEGINFO
=
$(
nslookup ffs-
$
{
NODEID
}
-
${
PUBKEY
}
.segassign.freifunk-stuttgart.de
[
::1]:54 |
grep
"2001:2:0:711::"
)
if
[
-z
"
$SEGINFO
"
]
;
then
logger
-t
$ME
"Node not known"
exit
1
...
...
@@ -33,11 +33,11 @@ CHANGED=0
for
i
in
`
seq
1 10
`
;
do
GW
=
$(
printf
"gw%02d"
$i
)
OLDPEER
=
$(
uci get fastd.mesh_vpn_backbone_peer_
$
GW
.remote
)
NEWPEER
=
"
\"
${
GW
}
s
$
SEGNUM
.gw.freifunk-stuttgart.de
\"
port
$PORT
"
OLDPEER
=
$(
uci get fastd.mesh_vpn_backbone_peer_
$
{
GW
}
.remote
)
NEWPEER
=
"
\"
${
GW
}
s
$
{
SEGNUM
}
.gw.freifunk-stuttgart.de
\"
port
$PORT
"
if
[
"
$NEWPEER
"
!=
"
$OLDPEER
"
]
;
then
uci
set
fastd.mesh_vpn_backbone_peer_
$
GW
.remote
=
"
$NEWPEER
"
uci
set
fastd.mesh_vpn_backbone_peer_
$
{
GW
}
.remote
=
"
$NEWPEER
"
CHANGED
=
1
fi
done
...
...
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