lookyloo/bin/stop.py

22 lines
399 B
Python
Raw Normal View History

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from subprocess import Popen
2021-09-07 12:59:31 +02:00
from redis import Redis
2021-09-07 12:59:31 +02:00
from lookyloo.helpers import get_homedir, get_socket_path
def main():
get_homedir()
p = Popen(['shutdown'])
p.wait()
r = Redis(unix_socket_path=get_socket_path('cache'), db=1)
r.delete('shutdown')
Popen(['run_backend', '--stop'])
if __name__ == '__main__':
main()