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
ba16b8bd
Commit
ba16b8bd
authored
8 years ago
by
root
Browse files
Options
Downloads
Patches
Plain Diff
Added ossibility to set MTU.
parent
5452ccc8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ffs-set-segment/files/usr/sbin/ffs-set-segment
+23
-10
23 additions, 10 deletions
ffs-set-segment/files/usr/sbin/ffs-set-segment
with
23 additions
and
10 deletions
ffs-set-segment/files/usr/sbin/ffs-set-segment
+
23
−
10
View file @
ba16b8bd
#!/bin/sh
if
[
$(
ps |
grep
-c
"{
$(
basename
$0
)
}"
)
-gt
4
]
;
then
echo
started twice
exit
1
fi
if
[
$(
ps |
grep
-c
"fastd"
)
-lt
2
]
;
then
echo
fastd not running
exit
0
fi
if
[
"
$(
uci get fastd.mesh_vpn_backbone.auto_segment
)
"
=
"0"
]
;
then
echo
auto_segment disabled
exit
0
fi
NODEID
=
`
uci get network.bat0.macaddr
`
for
i
in
`
seq
1 5
`
;
do
NODEID
=
${
NODEID
/\
:/
}
done
NODEID
=
ffs-
$NODEID
SEGMENT
=
`
nslookup
$NODEID
.segassign.freifunk-stuttgart.de
[
::1]:54 |tail
-n1
`
if
[[
-z
"
${
SEGMENT
//
}
"
]]
;
then
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 |
tail
-n1
`
if
[
-z
"
$SEGINFO
"
]
;
then
echo
Node not known
exit
1
fi
SEGMENT
=
${
SEGMENT
/Address 1
:
2001
:2:0:711::/
}
SEGINFO
=
${
SEGINFO
/Address 1
:
2001
:2:0:711::/
}
NEWMTU
=
$(
echo
$SEGINFO
|
cut
-d
':'
-s
-f1
)
SEGMENT
=
$(
echo
$SEGINFO
|
cut
-d
':'
-f2
)
let
PORT
=
SEGMENT+10040
SEGNUM
=
$(
printf
"%02d"
$SEGMENT
)
CHANGED
=
0
for
i
in
`
seq
1 10
`
;
do
...
...
@@ -38,6 +40,17 @@ do
fi
done
if
[
-n
"
$NEWMTU
"
]
;
then
OLDMTU
=
`
uci get fastd.mesh_vpn.mtu
`
if
[
"
$NEWMTU
"
!=
"
$OLDMTU
"
]
;
then
uci
set
fastd.mesh_vpn.mtu
=
"
$NEWMTU
"
CHANGED
=
1
fi
fi
if
[
"
$CHANGED
"
=
"1"
]
;
then
/etc/init.d/fastd restart
echo
Set Segment:
$SEGNUM
, MTU:
$NEWMTU
else
echo
No changes
fi
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