uhttpd: display errors in init script, code formatting changes, bump package version
[openwrt/openwrt.git] / package / uhttpd / files / uhttpd.init
index c370f901099b6456ede8d2acb8abbd0e1d40c498..d4037a1b981b0800a3047fe948d7b14ff0ff1e3f 100755 (executable)
@@ -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()