pyclock/scripts/redundancy/restart.py
2024-03-19 08:29:02 -05:00

12 lines
390 B
Python
Executable file

#!/home/benson/anaconda3/bin/python
import os
import subprocess
base_dir = os.path.dirname(os.path.realpath(__file__))
result = subprocess.run(["%s/ProcessExists" % (base_dir)], stdout=subprocess.PIPE)
res = int(result.stdout)
if res == 0 and os.path.isfile('%s/../time.txt' % (base_dir)):
subprocess.Popen('%s/LaunchInterrupt' % (base_dir))
else:
print("Don't need to restart!")