My Opera is closing 1st of March

M.I.T = Multimedia IT dept.

Subscribe to RSS feed

netstat check and restart service with perl: checkwms.bat

, , ,

@echo off

:: start checking whether the connection is alive in netstat!!
SET WMSPORT=1030
netstat | find "localhost:%WMSPORT%" > checkwms.log
SET WMSON=
for /f "tokens=4" %%A in (checkwms.log) do (SET WMSON=%%A)
if not "%WMSON%" == "ESTABLISHED" goto DOWN
echo WMS keeps running...
goto EXIT

:DOWN
:: print out down time to error log and restart WMServer...
for /f "tokens=1-2 usebackq" %%A in (`date /T`) do (SET NOWDATE=%%A %%B)
for /f "tokens=1-2 usebackq" %%A in (`time /T`) do (SET NOWTIME=%%A %%B)
echo %NOWDATE% %NOWTIME% WMS connection restarts...>> checkwmserr.txt
sc stop WMServer
sc start WMServer

:EXIT
echo exiting...
February 2014
M T W T F S S
January 2014March 2014
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28