aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/sbin
diff options
context:
space:
mode:
authorThibaut VARÈNE <hacks@slashdirt.org>2018-08-09 20:33:45 +0200
committerJo-Philipp Wich <jo@mein.io>2018-12-18 11:01:56 +0100
commita2b2a9c55fd9a4fa7e211dae35d3951cdcc2bafc (patch)
tree298fb27963f8c25f75b5c6fa06c3e9fc41e60f9f /package/base-files/files/sbin
parent7a52e0a7ab0847002c6f1e6d02083739ef641ab4 (diff)
downloadupstream-a2b2a9c55fd9a4fa7e211dae35d3951cdcc2bafc.tar.gz
upstream-a2b2a9c55fd9a4fa7e211dae35d3951cdcc2bafc.tar.bz2
upstream-a2b2a9c55fd9a4fa7e211dae35d3951cdcc2bafc.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> (backported from 78b5764fd8a3c133f0caf170238242b32a97105b)
Diffstat (limited to 'package/base-files/files/sbin')
-rwxr-xr-xpackage/base-files/files/sbin/wifi5
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