aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/bin/config_generate
diff options
context:
space:
mode:
Diffstat (limited to 'package/base-files/files/bin/config_generate')
-rwxr-xr-xpackage/base-files/files/bin/config_generate8
1 files changed, 4 insertions, 4 deletions
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index 80ed61b9e2..80e5c9f474 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -4,8 +4,8 @@ CFG=/etc/board.json
. /usr/share/libubox/jshn.sh
-[ -f $CFG ] || /bin/board_detect || exit 1
-[ -f /etc/config/network -a -f /etc/config/system ] && exit 0
+[ -s $CFG ] || /bin/board_detect || exit 1
+[ -s /etc/config/network -a -s /etc/config/system ] && exit 0
generate_static_network() {
uci -q batch <<-EOF
@@ -401,7 +401,7 @@ generate_gpioswitch() {
json_init
json_load "$(cat ${CFG})"
-if [ ! -f /etc/config/network ]; then
+if [ ! -s /etc/config/network ]; then
touch /etc/config/network
generate_static_network
@@ -412,7 +412,7 @@ if [ ! -f /etc/config/network ]; then
for key in $keys; do generate_switch $key; done
fi
-if [ ! -f /etc/config/system ]; then
+if [ ! -s /etc/config/system ]; then
touch /etc/config/system
generate_static_system