lookyloo/bin/stop.py

20 lines
397 B
Python
Executable File

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from subprocess import Popen
from lookyloo.helpers import get_homedir, get_socket_path
from redis import Redis
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()