Need help with addons

Hey guy’s do u perhaps know how to program a addon that auto restarts ur server after like 6 hours and if the server crashes it restarts ?
Btw i dont care what program language

Just use Windows Task Scheduler?

Create a batch file that contains these values:

@echo off
taskkill /IM srcds.exe
C:\MyServer\srcds.exe -console -game garrysmod etc

and make the Task Scheduler run it every 6 hours.

Its linux u know something for that

Use cron instead.

pkill srcds_linux
./srcds_linux -console -game garrysmod etc

Save it as or whatever you want.

Then add it to crontab by running:

crontab -e

And put this inside it:

0 */6 * * * /path/to/