Skip to content
Snippets Groups Projects
Unverified Commit b7380dec authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-mesh-batman-adv-*: add gluon_mesh protocol handlers

parent 5cd62952
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
exec /lib/gluon/mesh-batman-adv-core/config_mesh_interface setup 1528
#!/bin/sh
exec /lib/gluon/mesh-batman-adv-core/config_mesh_interface teardown
#!/bin/sh
exec /lib/gluon/mesh-batman-adv-core/config_mesh_interface setup 1532
#!/bin/sh
exec /lib/gluon/mesh-batman-adv-core/config_mesh_interface teardown
#!/usr/bin/lua
local util = require 'gluon.util'
local fs = require 'nixio.fs'
local ifname = os.getenv('IFNAME')
local cmd = arg[1]
if cmd == 'setup' then
local fixed_mtu = tonumber(os.getenv('FIXED_MTU')) or 0
local transitive = tonumber(os.getenv('TRANSITIVE')) or 0
local mtu = tonumber(arg[2])
if fixed_mtu == 0 then
local lower = fs.glob('/sys/class/net/' .. ifname .. '/lower_*/wireless')()
if lower then
lower = lower:match('/lower_([^/]+)/wireless$')
util.exec('ip', 'link', 'set', 'dev', lower, 'mtu', tostring(mtu+4))
end
util.exec('ip', 'link', 'set', 'dev', ifname, 'mtu', tostring(mtu))
end
local file = assert(io.open('/sys/class/net/' .. ifname .. '/batman_adv/mesh_iface', 'w'))
file:write('bat0')
file:close()
file = assert(io.open('/sys/class/net/' .. ifname .. '/batman_adv/no_rebroadcast', 'w'))
file:write(tostring(transitive))
file:close()
elseif cmd == 'teardown' then
local file = io.open('/sys/class/net/' .. ifname .. '/batman_adv/mesh_iface', 'w')
if file then
file:write('none')
file:close()
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment