BGP-Ranking/bin/shutdown.py

17 lines
436 B
Python
Raw Normal View History

2018-03-29 22:37:28 +02:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bgpranking.libs.helpers import is_running, get_socket_path
2018-03-29 22:37:28 +02:00
import time
from redis import StrictRedis
if __name__ == '__main__':
r = StrictRedis(unix_socket_path=get_socket_path('prefixes'), db=1, decode_responses=True)
2018-03-29 22:37:28 +02:00
r.set('shutdown', 1)
while True:
running = is_running()
print(running)
if not running:
break
time.sleep(10)