HI,Jow
Ask a stupid question again .
I added the following code within mywifi.lua
function o.write(self, section, value)
error = luci.sys.exec("iwconfig wlan0 channel %d",value)
luci.util.perror(error)
Value.write(self, section, value)
end
I want to know how to judge the command is executed incorrectly .
I didn't see the error output since i just use iwconfig instead of
private command iwxxx .
Thanks and Regards
Peter Meng
On Tue, Feb 28, 2012 at 10:21 PM, peter.meng <[email protected]> wrote:
> Thanks Jow and i will try it .
>
> Peter Meng
>
> On Tue, Feb 28, 2012 at 10:11 PM, Jo-Philipp Wich <[email protected]> wrote:
>> Hi,
>>
>> usually LuCI will call /etc/init.d/network restart, which in turn fires
>> /sbin/wifi up which then relies on the corresponding /lib/wifi/xxxx.sh
>> to perform the wifi setup as needed.
>>
>> If you really want to execute code from within the cbi, you can
>> overwrite the corresponding default actions, e.g. for the channel field:
>>
>> -- 8< --
>>
>> o = s:option(Value, "channel", translate("Set wifi channel"))
>>
>> function o.write(self, section, value)
>> luci.sys.call("iwxxxx wlan0 channel 11")
>> Value.write(self, section, value)
>> end
>>
>> -- >8 --
>>
>> ~ Jow
>> _______________________________________________
>> openwrt-users mailing list
>> [email protected]
>> https://lists.openwrt.org/mailman/listinfo/openwrt-users
_______________________________________________
openwrt-users mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-users