How to pass command line argumets inside Luci openwrt sys.exec() function ?

1.4k Views Asked by At

I want to execute a sys.exe function with command line arguments . my code is

var1 = "myname"
var2 = "address"
function btn.write()  
   luci.sys.exec("/bin/register $var1 $var2")
end

This is wrong i know . How can i pass arguments to a sys.exe function in Luci OpenWrt ? Any help ? Thanks .

1

There are 1 best solutions below

0
On BEST ANSWER

Use simple string concatenation:

luci.sys.exec("/bin/register" .. $var1 .. " " .. $var2 .. " ")