1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| @echo off :aaa
set str = "0" echo request.. curl -sL -w %%{http_code} xxx.com:/admin/index -o /dev/null > check.txt
set /p str=<check.txt
if not "%str%"=="200" ( echo %date% %time:~0,5% is error>>check.log echo. | call D:\wnmp\stop_nginx.bat ping -n 3 127.0.0.1>nul echo. | call D:\wnmp\start_nginx.bat ping -n 3 127.0.0.1>nul echo %date% %time:~0,5% start success>>check.log ) ping -n 60 127.0.0.1>nul goto aaa
|