Browse Source

base-files: generate /etc/config/wireless, if it doesn't exist

This patch adds a check in "wifi detect" to test if the wireless
configuration file does exist. If it doesn't exist, an empty
/etc/config/wireless file will be created.

This is necessary because uci doesn't create new files,
instead the tool just exits with "uci: Entry not found".

Signed-off-by: Mathias Kresin <[email protected]>
Signed-off-by: Christian Lamparter <[email protected]>
Mathias Kresin 9 years ago
parent
commit
ba3540db62
1 changed files with 2 additions and 0 deletions
  1. 2 0
      package/base-files/files/sbin/wifi

+ 2 - 0
package/base-files/files/sbin/wifi

@@ -146,6 +146,8 @@ wifi_reload() {
 }
 
 wifi_detect() {
+	[ ! -f /etc/config/wireless ] && touch /etc/config/wireless
+
 	for driver in $DRIVERS; do (
 		if eval "type detect_$driver" 2>/dev/null >/dev/null; then
 			eval "detect_$driver" || echo "$driver: Detect failed" >&2