Parcourir la source

gluon-mesh-batman-adv-core: don't print error message when no_rebroadcast is not supported

batman-adv 2017.0 doesn't need (or support) no_rebroadcast anymore. Don't
fail when the file doesn't exist.
Matthias Schiffer il y a 7 ans
Parent
commit
6499658b52

+ 5 - 3
package/gluon-mesh-batman-adv-core/luasrc/lib/gluon/mesh-batman-adv-core/config_mesh_interface

@@ -38,9 +38,11 @@ if cmd == 'setup' then
 	file:write('bat0')
 	file:close()
 
-	file = assert(io.open('/sys/class/net/' .. ifname .. '/batman_adv/no_rebroadcast', 'w'))
-	file:write(tostring(transitive))
-	file:close()
+	file = io.open('/sys/class/net/' .. ifname .. '/batman_adv/no_rebroadcast', 'w')
+	if file then
+		file:write(tostring(transitive))
+		file:close()
+	end
 
 elseif cmd == 'teardown' then