From 9f4c3932959f91f662ded5b5d2c9b741b0fa1423 Mon Sep 17 00:00:00 2001 From: bobcanthelpyou Date: Mon, 10 Jun 2019 19:01:04 +0200 Subject: [PATCH] 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 --- package/gluon-mesh-vpn-core/luasrc/usr/bin/gluon-wan | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/package/gluon-mesh-vpn-core/luasrc/usr/bin/gluon-wan b/package/gluon-mesh-vpn-core/luasrc/usr/bin/gluon-wan index 4df58285..d8072f8e 100755 --- a/package/gluon-mesh-vpn-core/luasrc/usr/bin/gluon-wan +++ b/package/gluon-mesh-vpn-core/luasrc/usr/bin/gluon-wan @@ -21,12 +21,11 @@ if ok ~= 0 then io.stderr:write(string.format("gluon-wan: unable to change to group: %s\n", err)) os.exit(1) end +local args = {[0] = arg[1], unpack(arg)} +table.remove(args, 1) -arg[0] = arg[1] -table.remove(arg, 1) -print(arg[0], unpack(arg)) - -ok, err = unistd.execp(arg[0], arg) +local _ +_, err = unistd.execp(args[0], args) io.stderr:write(string.format("gluon-wan: exec failed: %s\n", err)) os.exit(1)