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

LEDE Commits lede-commits at lists.infradead.org
Thu Nov 3 03:08:04 PDT 2016


nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/ba3540db6223a0107fd78decafea702a0537af7a

commit ba3540db6223a0107fd78decafea702a0537af7a
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Mon Oct 17 15:59:12 2016 +0200

    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 <dev at kresin.me>
    Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
---
 package/base-files/files/sbin/wifi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi
index 6bd3544..2ef333a 100755
--- a/package/base-files/files/sbin/wifi
+++ b/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



More information about the lede-commits mailing list