Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFS Gluon
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
Commits
317478e2
Commit
317478e2
authored
9 years ago
by
Matthias Schiffer
Browse files
Options
Downloads
Patches
Plain Diff
gluon-mesh-batman-adv-core: don't break network configuration on upgrades with mesh_on_lan=true
parent
a42db7a7
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
package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/340-gluon-mesh-batman-adv-core-mesh-on-lan
+19
-10
19 additions, 10 deletions
.../gluon/upgrade/340-gluon-mesh-batman-adv-core-mesh-on-lan
with
19 additions
and
10 deletions
package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/340-gluon-mesh-batman-adv-core-mesh-on-lan
+
19
−
10
View file @
317478e2
#!/usr/bin/lua
local
site
=
require
'gluon.site_config'
local
uci
=
require
'luci.model.uci'
local
util
=
require
'gluon.util'
local
sysconfig
=
require
'gluon.sysconfig'
local
c
=
uci
.
cursor
()
local
uci
=
require
(
'luci.model.uci'
).
cursor
()
local
lutil
=
require
'luci.util'
if
sysconfig
.
lan_ifname
then
if
not
c
:
get
(
'network'
,
'mesh_lan'
)
then
c
:
section
(
'network'
,
'interface'
,
'mesh_lan'
,
if
sysconfig
.
lan_ifname
and
not
uci
:
get
(
'network'
,
'mesh_lan'
)
then
local
enable
=
site
.
mesh_on_lan
if
enable
then
local
interfaces
=
uci
:
get
(
'network'
,
'client'
,
'ifname'
)
if
interfaces
and
lutil
.
contains
(
interfaces
:
split
(
' '
),
sysconfig
.
lan_ifname
)
then
enable
=
false
end
end
uci
:
section
(
'network'
,
'interface'
,
'mesh_lan'
,
{
ifname
=
sysconfig
.
lan_ifname
,
proto
=
'batadv'
,
mesh
=
'bat0'
,
macaddr
=
util
.
generate_mac
(
1
,
1
)
,
auto
=
site
.
mesh_on_lan
and
1
or
0
})
end
,
auto
=
enable
and
1
or
0
})
uci
:
save
(
'network'
)
uci
:
commit
(
'network'
)
end
c
:
save
(
'network'
)
c
:
commit
(
'network'
)
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