aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files
diff options
context:
space:
mode:
authorMathias Kresin <dev@kresin.me>2016-10-17 15:59:12 +0200
committerFelix Fietkau <nbd@nbd.name>2016-11-03 11:08:01 +0100
commitba3540db6223a0107fd78decafea702a0537af7a (patch)
treeb44892f25e310a54a0fe14cdf47f2da68c052294 /package/base-files/files
parentf78405f5009197b76804b65aefb2f45acada1787 (diff)
downloadupstream-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>
Diffstat (limited to 'package/base-files/files')
-rwxr-xr-xpackage/base-files/files/sbin/wifi2
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