I have caught the value in the config file like this:
file = io.open("testch", "r") -- testch is config file in same directory
file:read("*l")
file:seek("cur", 17)
version = file:read("*l")
_, _, version = string.find(version, "(%d+.%d+)'")
file:seek("cur", 19)
serialnum = file:read("*l")
_, _, serialnum = string.find(serialnum, "(%d+)'")
file:seek("cur", 15)
power = file:read("*l")
_, _, power = string.find(power, "(%d+)'")
io.close(file)
/* below code is config file in the same directory with upper one */
config test
option version '1.0'
option serialnum '1234567890'
option power '30'
However, when I click the Save&Apply button in the Luci for changing the value in config file, the changed array goes to below.
That's my problem. When config file's array order is changed, my solution can't apply in that case. (My solution can be applied in fixed case.)
Is there a solution that can apply to every case(with config file's array is changed case)?