Message ID | 20180806085217.44075-1-hacks@slashdirt.org |
---|---|
State | Accepted |
Delegated to: | John Crispin |
Headers | show |
Series | [OpenWrt-Devel] base-files: make wifi report unknown command | expand |
diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi index 83befc0d6f..13c91c2919 100755 --- a/package/base-files/files/sbin/wifi +++ b/package/base-files/files/sbin/wifi @@ -241,5 +241,6 @@ case "$1" in reload) wifi_reload "$2";; reload_legacy) wifi_reload_legacy "$2";; --help|help) usage;; - *) ubus call network reload; wifi_updown "enable" "$2";; + '') ubus call network reload; wifi_updown "enable";; + *) usage; exit 1;; esac
Avoid having /sbin/wifi silently ignore unknown keywords and execute "enable"; instead display the help message and exit with an error. Also preserve the implicit assumption that runing /sbin/wifi without argument performs network reload and "enable". Signed-off-by: Thibaut VARĂˆNE <hacks@slashdirt.org> --- package/base-files/files/sbin/wifi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)