diff options
author | Mathias Kresin <dev@kresin.me> | 2016-10-17 15:59:12 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2016-11-03 11:08:01 +0100 |
commit | ba3540db6223a0107fd78decafea702a0537af7a (patch) | |
tree | b44892f25e310a54a0fe14cdf47f2da68c052294 | |
parent | f78405f5009197b76804b65aefb2f45acada1787 (diff) | |
download | upstream-ba3540db6223a0107fd78decafea702a0537af7a.tar.gz upstream-ba3540db6223a0107fd78decafea702a0537af7a.tar.bz2 upstream-ba3540db6223a0107fd78decafea702a0537af7a.zip |
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@kresin.me>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
-rwxr-xr-x | package/base-files/files/sbin/wifi | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi index 6bd3544fcb..2ef333a782 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 |