Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFS Gluon Packages
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
firmware
FFS Gluon Packages
Commits
2417ef72
Commit
2417ef72
authored
4 years ago
by
root
Browse files
Options
Downloads
Patches
Plain Diff
Keep Segment setting if DNS is temporary not available.
parent
caff6fa7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ffs-set-segment/files/etc/init.d/ffs-set-segment
+1
-0
1 addition, 0 deletions
ffs-set-segment/files/etc/init.d/ffs-set-segment
ffs-set-segment/files/usr/sbin/ffs-set-segment
+11
-2
11 additions, 2 deletions
ffs-set-segment/files/usr/sbin/ffs-set-segment
with
12 additions
and
2 deletions
ffs-set-segment/files/etc/init.d/ffs-set-segment
+
1
−
0
View file @
2417ef72
...
...
@@ -8,6 +8,7 @@ start () {
/etc/init.d/fastd restart
fi
rm
/tmp/.seg.ffs
/etc/init.d/micrond
enable
/etc/init.d/micrond restart
}
...
...
This diff is collapsed.
Click to expand it.
ffs-set-segment/files/usr/sbin/ffs-set-segment
+
11
−
2
View file @
2417ef72
#!/bin/sh
SEGSET
=
/tmp/.seg.ffs
ME
=
$(
basename
$0
)
if
[
$(
ps |
grep
-c
"
$ME
"
)
-gt
4
]
;
then
logger
-s
-t
$ME
"started twice"
...
...
@@ -23,12 +25,18 @@ BATSEG=$(batctl gwl | grep '02:00:3' | tail -1 | sed 's/:0/:/g' | cut -d':' -f4)
GITSEG
=
$(
nslookup ffs-
${
NODEID
}
-
${
PUBKEY
}
.segassign.freifunk-stuttgart.de ::1#54 |
grep
"2001:2:0:711::"
|
cut
-d
':'
-f7
)
if
[
-z
"
$GITSEG
"
]
;
then
logger
-t
$ME
"Node not registered"
GITSEG
=
99
if
[
-f
$SEGSET
]
;
then
GITSEG
=
$(
cat
$SEGSET
)
logger
-t
$ME
"Node is in Segment:
$GITSEG
"
else
logger
-t
$ME
"Node not registered"
GITSEG
=
99
fi
else
if
[
-n
"
$BATSEG
"
]
&&
[
"
$BATSEG
"
!=
"
$GITSEG
"
]
;
then
logger
-t
$ME
"Avoiding Shortcut"
GITSEG
=
99
rm
$SEGSET
fi
fi
...
...
@@ -51,6 +59,7 @@ if [ "$CHANGED" = "1" ]; then
/sbin/ifdown client
/etc/init.d/fastd restart
/sbin/ifup client
echo
$GITSEG
>
$SEGSET
logger
-t
$ME
"Set Segment:
$GITSEG
"
else
logger
-t
$ME
"No changes"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment