ubuntuluaopenwrtluci

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


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 .


Solution

  • Use simple string concatenation:

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