added notifications
added freepbx integration as notification source
This commit is contained in:
12
update.py
12
update.py
@@ -6,7 +6,8 @@ from time import sleep
|
||||
import subprocess
|
||||
from pynput import mouse
|
||||
from functools import partial
|
||||
from os import name, path, remove, system
|
||||
from os import name, path, remove, system, kill, popen
|
||||
import signal
|
||||
|
||||
|
||||
# while True:
|
||||
@@ -53,7 +54,16 @@ while True:
|
||||
except urllib.error.HTTPError:
|
||||
print("No update available.")
|
||||
pass
|
||||
for line in popen("ps ax | grep " + "web.py" + " | grep -v grep"):
|
||||
fields = line.split()
|
||||
pid = fields[0]
|
||||
kill(int(pid), signal.SIGKILL)
|
||||
subprocess.Popen(['python3', 'web/web.py'])
|
||||
for line in popen("ps ax | grep " + "freepbx.py" + " | grep -v grep"):
|
||||
fields = line.split()
|
||||
pid = fields[0]
|
||||
kill(int(pid), signal.SIGKILL)
|
||||
subprocess.Popen(['python3', 'freepbx.py'])
|
||||
subprocess.check_call(['python3', 'spotifycontroller.py'])
|
||||
except Exception as e:
|
||||
if e.args[0] == 1:
|
||||
|
||||
Reference in New Issue
Block a user