Browse Source

base-files: Added a deprecation notice on wifi detect

When running wifi detect, the user will be told on error output that
wifi detect is deprecated, that wifi config must be used instead. Also
the commit that changes it is referenced for further info.

Signed-off-by: David Pinilla Caparrós <[email protected]>
David Pinilla Caparrós 8 years ago
parent
commit
a896611acd
1 changed files with 7 additions and 1 deletions
  1. 7 1
      package/base-files/files/sbin/wifi

+ 7 - 1
package/base-files/files/sbin/wifi

@@ -145,6 +145,12 @@ wifi_reload() {
 	wifi_reload_legacy
 	wifi_reload_legacy
 }
 }
 
 
+wifi_detect_notice() {
+	>&2 echo "WARNING: Wifi detect is deprecated. Use wifi config instead"
+	>&2 echo "For more information, see commit 5f8f8a366136a07df661e31decce2458357c167a"
+	exit 1
+}
+
 wifi_config() {
 wifi_config() {
 	[ ! -f /etc/config/wireless ] && touch /etc/config/wireless
 	[ ! -f /etc/config/wireless ] && touch /etc/config/wireless
 
 
@@ -229,7 +235,7 @@ scan_wifi
 
 
 case "$1" in
 case "$1" in
 	down) wifi_updown "disable" "$2";;
 	down) wifi_updown "disable" "$2";;
-	detect) ;;
+	detect) wifi_detect_notice ;;
 	config) wifi_config ;;
 	config) wifi_config ;;
 	status) ubus_wifi_cmd "status" "$2";;
 	status) ubus_wifi_cmd "status" "$2";;
 	reload) wifi_reload "$2";;
 	reload) wifi_reload "$2";;