change ipaddr in luci

110 Views Asked by At

I want to change my ipaddr to use uci command. Here is my code.

v = "111.111.111.11"

local ipaddr = io.popen("uci set network.lan.ipaddr='%s'", v)
ipaddr:close()

I know the code must have an error. However, I want to change the ip address to v value. Is there any solution?

1

There are 1 best solutions below

0
On

Try

io.popen(string.format("uci set network.lan.ipaddr='%s'", v))