Someone have a script .bat for reboot silentarmy-cywin on windows ? I have some crashs

I'd like to see a linux script for rebooting after GPU crashes. I don't know how to have the script detect a GPU crash so right now I just am using a script that restarts the rig and miner every hour or so. But it would be much more efficient if it only rebooted the computer when a GPU crashed.
At first
# pip install sh
or
apt-get install python-sh
then follow output of the miner to log-file, for example /var/run/miner.output
start the watchdog.py loop:
#!/usr/bin/python
from sh import tail
import re
import subprocess
from datetime import datetime, timedelta
reg = re.compile('dev(\d) (\d+\.\d)')
fail_ = {}
for line in tail("-f", "/var/run/miner.output", _iter=True):
solrate = {int(s[0]): float(s[1]) for s in reg.findall(line)}
print '%.2f: %s' % (sum(solrate.values()), solrate)
for gpu in solrate:
if solrate[gpu] < 10:
if not fail_.get(gpu):
fail_[gpu] = datetime.now()
elif datetime.now() - fail_[gpu] > timedelta(seconds=60):
print 'REBOOTING'
print datetime.now()
subprocess.call('reboot', shell=True)
# TODO: edit your reboot command here
exit(1)
else:
fail_[gpu] = None