fix: restart nginx if ESPConnect update fails

This commit is contained in:
John Lombardo
2026-04-28 22:38:07 +08:00
parent b319e478a2
commit 1ed6dc4f7d

View File

@@ -35,7 +35,11 @@ function update_script() {
systemctl stop nginx
msg_ok "Stopped Nginx"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "espconnect" "thelastoutpostworkshop/ESPConnect" "prebuild" "latest" "/opt/espconnect" "dist.zip"
if ! CLEAN_INSTALL=1 fetch_and_deploy_gh_release "espconnect" "thelastoutpostworkshop/ESPConnect" "prebuild" "latest" "/opt/espconnect" "dist.zip"; then
msg_error "Failed to update ${APP}; restarting Nginx"
systemctl start nginx
exit 1
fi
msg_info "Starting Nginx"
systemctl start nginx