[OpenWrt-Devel] [PATCH] base-files: make wifi report unknown command

Alberto Bursi bobafetthotmail at gmail.com
Mon Aug 6 10:58:49 EDT 2018



On 06/08/2018 07:20, John Crispin wrote:
>
>
> On 03/08/18 18:18, Thibaut VARÈNE wrote:
>> Avoid having /sbin/wifi silently ignore unknown keywords and execute
>> "enable"; instead display the help message and exit with an error.
>>
>> Signed-off-by: Thibaut VARÈNE <hacks at slashdirt.org>
>> ---
>>   package/base-files/files/sbin/wifi | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/package/base-files/files/sbin/wifi 
>> b/package/base-files/files/sbin/wifi
>> index 83befc0d6f..09e483ec55 100755
>> --- a/package/base-files/files/sbin/wifi
>> +++ b/package/base-files/files/sbin/wifi
>> @@ -241,5 +241,5 @@ case "$1" in
>>       reload) wifi_reload "$2";;
>>       reload_legacy) wifi_reload_legacy "$2";;
>>       --help|help) usage;;
>> -    *) ubus call network reload; wifi_updown "enable" "$2";;
>> +    *) usage; exit 1;;
>>   esac
>
> NAK, this changes expected behaviour. i regularly call "wifi" to 
> resync my config with runstate.
>     John
>

There are also scripts in packages (like wifitoggle) that expect to call 
"wifi" without arguments to do a status refresh.

Please make it print an error only if "wifi" is actually called with an 
unknown (=wrong) argument, calling "wifi" with no argument is ok.

-Alberto

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list