u may check if the server response after a timelimit, if not then restart him
check again, if he is up then do nothing.
this can be done with a bash script
another method is to fix under ubuntu/debian the hlds_run bug
open hlds_run search for: DEBUG=0 change to: DEBUG=""
save the file and restart the server.
but this will not restart the server after segmentation faults.
other method is that u check the logs if there is some sort
of $HL_CMD segmentation fault, then restart him
there are many things u may do, but u need at least knownledge
about those stuff and linux also.
oh and just to mention, figure out why the server is crashing. ;)
and after this try to resolve the problem accordingly