Advertisement
Sevaver

Valheimmonitor

Nov 22nd, 2023 (edited)
1,177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.35 KB | Source Code | 0 0
  1. @echo off
  2. :: ====================================
  3. :: FILE NAME: valheimmonitor.bat
  4. :: AUTHOR: MokeyII
  5. :: Editor: Sevaver
  6. :: Directions: Place "valheimmonitor.bat" in your valheim WIN64 Directory
  7. :: Set your path below
  8. :: Example: (SET valheimPath=YOUR PATH HERE)
  9. :: ====================================
  10. ::
  11. :: _____Set your valheim Path Here_____
  12. ::
  13. SET valheimPath=C:\Steam\valheim
  14. ::
  15. :: Be Sure to Convert to an EXE after defining path.
  16. ::========================
  17. :: DO NOT EDIT BELOW HERE
  18. ::========================
  19. COLOR 30
  20. :valheimmonitor
  21. SET img=valheim_server.exe
  22. tasklist /fi "imagename eq %img%" /fi "status eq running" |find  /i "%img%"  >nul && (
  23. echo =======================================================
  24. echo Valheim Server is running, continuing to monitor.
  25. echo =======================================================
  26. PING 1.1.1.1 -n 1 -w 2500>nul
  27. goto valheimmonitor
  28. ) || (
  29. COLOR 4F
  30. PING 1.1.1.1 -n 1 -w 500>nul
  31. echo =======================================================
  32. echo %date% %TIME%  SERVER IS NOT RUNNING, RESTARTING SERVER NOW!!
  33. echo =======================================================
  34. >>crashreport.txt (
  35. echo %date% %TIME%  SERVER IS NOT RUNNING RESTART.BAT INITIATED!
  36. )
  37. PING 1.1.1.1 -n 1 -w 2000>nul
  38. COLOR 4F
  39. start "valheimServer" "%valheimPath%\valheimReboot.bat"
  40. echo Server startup initiated!
  41. exit
  42. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement