lookyloo/bin/shutdown.py

18 lines
421 B
Python
Raw Normal View History

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from lookyloo.helpers import is_running, get_socket_path
import time
from redis import StrictRedis
if __name__ == '__main__':
r = StrictRedis(unix_socket_path=get_socket_path('cache'), db=1)
r.set('shutdown', 1)
time.sleep(5)
while True:
running = is_running()
if not running:
break
print(running)
time.sleep(5)