Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
ffbs-gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ffbs
ffbs-gluon
Commits
f82850fc
Commit
f82850fc
authored
10 years ago
by
Matthias Schiffer
Browse files
Options
Downloads
Patches
Plain Diff
gluon-mesh-batman-adv: convert mesh config upgrade script to Lua
parent
3dddafea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
package/gluon-mesh-batman-adv/files/lib/gluon/upgrade/mesh-batman-adv/invariant/011-mesh
+53
-34
53 additions, 34 deletions
...iles/lib/gluon/upgrade/mesh-batman-adv/invariant/011-mesh
with
53 additions
and
34 deletions
package/gluon-mesh-batman-adv/files/lib/gluon/upgrade/mesh-batman-adv/invariant/011-mesh
+
53
−
34
View file @
f82850fc
#!/bin/
sh
#!/
usr/
bin/
lua
.
/lib/functions.sh
.
/lib/gluon/functions/sysconfig.sh
.
/lib/gluon/functions/sysctl.sh
local
sysconfig
=
require
'gluon.sysconfig'
local
sysctl
=
require
'gluon.sysctl'
local
uci
=
require
(
'luci.model.uci'
).
cursor
()
uci_remove batman-adv bat0
uci_add batman-adv mesh bat0
uci_set batman-adv bat0 orig_interval
'5000'
uci_set batman-adv bat0 gw_mode
'client'
uci_commit batman-adv
uci
:
delete
(
'batman-adv'
,
'bat0'
)
uci
:
section
(
'batman-adv'
,
'mesh'
,
'bat0'
,
{
orig_interval
=
5000
,
gw_mode
=
'client'
,
}
)
uci
:
save
(
'batman-adv'
)
uci
:
commit
(
'batman-adv'
)
uci_set network client macaddr
"
$(
sysconfig primary_mac
)
"
uci_set network client peerdns
'1'
uci_remove network bat0
uci_add network interface bat0
uci_set network bat0 ifname
'bat0'
uci_set network bat0 proto
'none'
uci_set network bat0 macaddr
"
$(
sysconfig primary_mac
)
"
uci_commit network
uci
:
set
(
'network'
,
'client'
,
'macaddr'
,
sysconfig
.
primary_mac
)
uci
:
set
(
'network'
,
'client'
,
'peerdns'
,
1
)
uci_remove firewall client
uci_add firewall zone client
uci_set firewall client name
'client'
uci add_list firewall.client.network
=
'client'
uci_set firewall client input
'ACCEPT'
uci_set firewall client output
'ACCEPT'
uci_set firewall client forward
'REJECT'
uci
:
delete
(
'network'
,
'bat0'
)
uci
:
section
(
'network'
,
'interface'
,
'bat0'
,
{
ifname
=
'bat0'
,
proto
=
'none'
,
macaddr
=
sysconfig
.
primary_mac
,
}
)
uci_commit firewall
uci
:
save
(
'network'
)
uci
:
commit
(
'network'
)
uci_set dhcp
'@dnsmasq[0]'
boguspriv
'0'
uci_set dhcp
'@dnsmasq[0]'
localise_queries
'0'
uci_set dhcp
'@dnsmasq[0]'
rebind_protection
'0'
uci
:
delete
(
'firewall'
,
'client'
)
uci
:
section
(
'firewall'
,
'zone'
,
'client'
,
{
name
=
'client'
,
network
=
{
'client'
},
input
=
'ACCEPT'
,
output
=
'ACCEPT'
,
forward
=
'REJECT'
,
}
)
uci
:
save
(
'firewall'
)
uci
:
commit
(
'firewall'
)
uci_remove dhcp client
uci_add dhcp dhcp client
uci_set dhcp client interface
'client'
uci_set dhcp client ignore
'1'
uci_commit dhcp
local
dnsmasq
=
uci
:
get_first
(
'dhcp'
,
'dnsmasq'
)
uci
:
set
(
'dhcp'
,
dnsmasq
,
'boguspriv'
,
0
)
uci
:
set
(
'dhcp'
,
dnsmasq
,
'localise_queries'
,
0
)
uci
:
set
(
'dhcp'
,
dnsmasq
,
'rebind_protection'
,
0
)
uci
:
delete
(
'dhcp'
,
'client'
)
uci
:
section
(
'dhcp'
,
'dhcp'
,
'client'
,
{
interface
=
'client'
,
ignore
=
1
,
}
)
sysctl_set net.ipv6.conf.br-client.forwarding 0
uci
:
save
(
'dhcp'
)
uci
:
commit
(
'dhcp'
)
sysctl
.
set
(
'net.ipv6.conf.br-client.forwarding'
,
0
)
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