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

Kevin Darbyshire-Bryant kevin at darbyshire-bryant.me.uk
Tue Aug 7 04:55:41 EDT 2018



> On 6 Aug 2018, at 15:49, Karl Palsson <karlp at tweak.net.au> wrote:
> 
> Signed PGP part
> 
> John Crispin <john at phrozen.org> 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
> 
> respectfully, the behaviour of the "wifi" command is one of the most obtuse parts of openwrt's tooling.  It does "something" with no command output, and responds ~instantly.    This is expected behaviour for very few people.  even "wifi asdfasdfa" returns ~instantly, with no warning that it is an unknown command.  Does the command perhaps not take arguments?  What would they be?
> 
> Do we _reallly_ have to keep it's behaviour this way?
> 
> What this patch _is_ missing, is a new command to replace the old
> "anything but the other commands".
> 
> ie, the one that does "ubus call network reload; wifi_updown
> "enable" "$2""
> 
> Sincerely,
> Karl Palsson
> 

+1
Nicely written and argued.  ‘wifi’ is incredibly obtuse and unfriendly.  I hate running it.  Does ‘magic’ no idea what, it doesn’t say.



Cheers,

Kevin D-B

012C ACB2 28C6 C53E 9775  9123 B3A2 389B 9DE2 334A

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20180807/7c215115/attachment.sig>
-------------- next part --------------
_______________________________________________
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