diff --git a/update.ps1 b/update.ps1 index 790099d..d6cc544 100644 --- a/update.ps1 +++ b/update.ps1 @@ -45,7 +45,17 @@ $local = git rev-parse HEAD $remote = git rev-parse FETCH_HEAD if ($local -eq $remote) { - Log "Nicio actualizare disponibila." "Gray" + # Verify service is running even when no updates + $status = (nssm status GoMagVending 2>&1) -replace '\0','' + if ($status -ne 'SERVICE_RUNNING') { + Log "Nicio actualizare, dar serviciul nu ruleaza ($status). Restart..." "Yellow" + nssm restart GoMagVending 2>&1 | Out-Null + Start-Sleep -Seconds 3 + $status = (nssm status GoMagVending 2>&1) -replace '\0','' + Log "Serviciu: $status" "Green" + } else { + Log "Nicio actualizare disponibila." "Gray" + } exit 0 }