#!/usr/bin/python

import os
import time

while True:
    status = os.popen('systemctl status snortd | grep Active').readlines()[0].strip().split('(')[1].split(')')[0]
    if status != 'running' and status != 'start':
        os.system('systemctl restart snortd')
    time.sleep(60)

