summaryrefslogtreecommitdiffstats
path: root/package/uhttpd/files/uhttpd.init
diff options
context:
space:
mode:
Diffstat (limited to 'package/uhttpd/files/uhttpd.init')
-rwxr-xr-xpackage/uhttpd/files/uhttpd.init5
1 files changed, 5 insertions, 0 deletions
diff --git a/package/uhttpd/files/uhttpd.init b/package/uhttpd/files/uhttpd.init
index c370f9010..d4037a1b9 100755
--- a/package/uhttpd/files/uhttpd.init
+++ b/package/uhttpd/files/uhttpd.init
@@ -108,6 +108,11 @@ start_instance()
SERVICE_PID_FILE=/var/run/uhttpd_${cfg}.pid
service_start $UHTTPD_BIN -f $UHTTPD_ARGS
+
+ # Check if daemon is running, if not then
+ # re-execute in foreground to display error.
+ sleep 1 && service_check $UHTTPD_BIN || \
+ $UHTTPD_BIN -f $UHTTPD_ARGS
}
stop_instance()