diff options
author | Thibaut VARÈNE <hacks@slashdirt.org> | 2018-08-09 20:33:45 +0200 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2018-08-10 05:30:57 +0200 |
commit | 78b5764fd8a3c133f0caf170238242b32a97105b (patch) | |
tree | 1cded53e0d4fb4899a796d079118029678d074e9 /package/base-files/files/sbin | |
parent | c4931713df8ffb3c4e5c1be7d0b6d4aa96a7dd4c (diff) | |
download | upstream-78b5764fd8a3c133f0caf170238242b32a97105b.tar.gz upstream-78b5764fd8a3c133f0caf170238242b32a97105b.tar.bz2 upstream-78b5764fd8a3c133f0caf170238242b32a97105b.zip |
base-files: make wifi report unknown command
Avoid having /sbin/wifi silently ignore unknown keywords and execute
"up"; instead display the help message and exit with an error.
Spell out the "up" keyword (which has users), add it to usage output,
and preserve the implicit assumption that runing /sbin/wifi without
argument performs "up".
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Diffstat (limited to 'package/base-files/files/sbin')
-rwxr-xr-x | package/base-files/files/sbin/wifi | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi index 83befc0d6f..f7a10de215 100755 --- a/package/base-files/files/sbin/wifi +++ b/package/base-files/files/sbin/wifi @@ -6,7 +6,7 @@ usage() { cat <<EOF -Usage: $0 [config|down|reload|status] +Usage: $0 [config|up|down|reload|status] enables (default), disables or configures devices not yet configured. EOF exit 1 @@ -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";; + ''|up) ubus call network reload; wifi_updown "enable" "$2";; + *) usage; exit 1;; esac |