aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/bin/board_detect
diff options
context:
space:
mode:
authorKoen Vandeputte <koen.vandeputte@ncentric.com>2016-10-05 11:26:35 +0200
committerFelix Fietkau <nbd@nbd.name>2016-10-05 19:59:11 +0200
commit0f27096100a33421bff0d4539d428fe393eebe22 (patch)
tree76f6304d3a0df849d76a123dafc93c9254c102f0 /package/base-files/files/bin/board_detect
parent7659f9ad9e5d6ffea93bd73989535346f0b14131 (diff)
downloadupstream-0f27096100a33421bff0d4539d428fe393eebe22.tar.gz
upstream-0f27096100a33421bff0d4539d428fe393eebe22.tar.bz2
upstream-0f27096100a33421bff0d4539d428fe393eebe22.zip
base-files: also generate configs when current is empty (FS#193)
Before a configuration is generated, an empty file is created to store it in. (required by UCI) If something happens during config generation (power cut, interruption, ..) an empty file exists and it is never regenerated again, causing some daemons to fail starting (NTPD, logread, ..) Fix this by also generating new configs if a critical file is empty. Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Diffstat (limited to 'package/base-files/files/bin/board_detect')
-rwxr-xr-xpackage/base-files/files/bin/board_detect4
1 files changed, 2 insertions, 2 deletions
diff --git a/package/base-files/files/bin/board_detect b/package/base-files/files/bin/board_detect
index f9640f0388..441db6a08f 100755
--- a/package/base-files/files/bin/board_detect
+++ b/package/base-files/files/bin/board_detect
@@ -4,11 +4,11 @@ CFG=$1
[ -n "$CFG" ] || CFG=/etc/board.json
-[ -d "/etc/board.d/" -a ! -f "$CFG" ] && {
+[ -d "/etc/board.d/" -a ! -s "$CFG" ] && {
for a in `ls /etc/board.d/*`; do
[ -x $a ] || continue;
$(. $a)
done
}
-[ -f "$CFG" ] || return 1
+[ -s "$CFG" ] || return 1