29 lines
1.2 KiB
PowerShell
29 lines
1.2 KiB
PowerShell
$ErrorActionPreference = "Continue"
|
|
Write-Output "=== admin current files ==="
|
|
Test-Path "E:\wwwroot\admin\current\index.html"
|
|
Get-ChildItem "E:\wwwroot\admin\current" | Select-Object Name -First 10
|
|
|
|
Write-Output "=== nginx root line ==="
|
|
Select-String -Path "C:\nginx-1.18.0\myconf\ai.conf" -Pattern "^\s*root " | ForEach-Object { $_.Line.Trim() }
|
|
|
|
Write-Output "=== hard restart nginx ==="
|
|
Get-Process nginx -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
|
|
Start-Sleep -Seconds 2
|
|
try {
|
|
Start-Service Nginx1.18 -ErrorAction Stop
|
|
Write-Output "SERVICE_STARTED"
|
|
} catch {
|
|
Write-Output "SERVICE_FAIL=$_"
|
|
Start-Process -FilePath "C:\nginx-1.18.0\nginx.exe" -WorkingDirectory "C:\nginx-1.18.0" -WindowStyle Hidden
|
|
Start-Sleep -Seconds 2
|
|
}
|
|
Get-Service Nginx1.18 | Format-List Name, Status
|
|
Get-Process nginx -ErrorAction SilentlyContinue | Select-Object Id
|
|
|
|
cmd /c "curl.exe -sk -o NUL -w root:%{http_code} -H `"Host: ai.ytd-scm.com`" https://127.0.0.1/"
|
|
Write-Output ""
|
|
cmd /c "curl.exe -sk -H `"Host: ai.ytd-scm.com`" https://127.0.0.1/agent/health"
|
|
Write-Output ""
|
|
cmd /c "curl.exe -sk -H `"Host: ai.ytd-scm.com`" https://127.0.0.1/index.html" | Select-Object -First 8
|
|
Write-Output "FIX_DONE"
|