File tree Expand file tree Collapse file tree 1 file changed +15
-12
lines changed
Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -873,18 +873,21 @@ npm link "${api_base_directory}" --force
873873# bail if expected file does not exist
874874[[ ! -f "${api_base_directory}/package.json" ]] && echo "unraid-api install failed" && exit 1
875875
876- ${unraid_binary_path} start
877-
878- # start background process to start flash backup
879- echo
880- if [ -f /var/local/emhttp/var.ini ]; then
881- # the system has fully booted, emhttpd and nginx are running
882- echo "Starting flash backup (if enabled)"
883- echo "/etc/rc.d/rc.flash_backup start" | at -M now &>/dev/null
884- # else
885- # the system is booting, emhttpd will install the api and start rc.flash_backup. rc.nginx will start the api.
886- # nothing to do here
887- fi
876+ # Start a background process to wait for /var/local/emhttp/var.ini
877+ ( timeout=30 elapsed=0
878+ while (( elapsed < timeout )); do
879+ if [ -f /var/local/emhttp/var.ini ]; then
880+ logger "Starting flash backup (if enabled)"
881+ echo "/etc/rc.d/rc.flash_backup start" | at -M now &>/dev/null
882+ logger "Starting Unraid API"
883+ ${unraid_binary_path} start
884+ exit 0
885+ fi
886+ sleep 1
887+ (( elapsed++ ))
888+ done
889+ echo "Timeout waiting for /var/local/emhttp/var.ini"
890+ ) &
888891
889892echo
890893echo "✅ Installation is complete, it is safe to close this window"
You can’t perform that action at this time.
0 commit comments