gluon-mesh-vpn-core: fix luacheck warnings

./gluon-wan:25:1: (W122) setting read-only field ? of global arg
./gluon-wan:29:1: (W311) value assigned to variable ok is unused
This commit is contained in:
bobcanthelpyou 2019-06-10 19:01:04 +02:00
parent 709c1b1b91
commit 9f4c393295

View File

@ -21,12 +21,11 @@ if ok ~= 0 then
io.stderr:write(string.format("gluon-wan: unable to change to group: %s\n", err)) io.stderr:write(string.format("gluon-wan: unable to change to group: %s\n", err))
os.exit(1) os.exit(1)
end end
local args = {[0] = arg[1], unpack(arg)}
table.remove(args, 1)
arg[0] = arg[1] local _
table.remove(arg, 1) _, err = unistd.execp(args[0], args)
print(arg[0], unpack(arg))
ok, err = unistd.execp(arg[0], arg)
io.stderr:write(string.format("gluon-wan: exec failed: %s\n", err)) io.stderr:write(string.format("gluon-wan: exec failed: %s\n", err))
os.exit(1) os.exit(1)