diff options
author | Devaev Maxim <[email protected]> | 2018-06-30 06:05:10 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-06-30 06:05:10 +0300 |
commit | d921d0d6c44db900e86c4cb50f97c1428dd24edb (patch) | |
tree | 779fc7fb340c3b67575e8bb5a6e836579eddc3c0 /kvmd | |
parent | c0aee642467655952d701e37f284a7a589d638e2 (diff) |
fixed cleanup
Diffstat (limited to 'kvmd')
-rw-r--r-- | kvmd/kvmd/extras/cleanup/__init__.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/kvmd/kvmd/extras/cleanup/__init__.py b/kvmd/kvmd/extras/cleanup/__init__.py index 040accdf..4e438e0f 100644 --- a/kvmd/kvmd/extras/cleanup/__init__.py +++ b/kvmd/kvmd/extras/cleanup/__init__.py @@ -1,3 +1,4 @@ +import os import subprocess import time @@ -20,13 +21,14 @@ def main() -> None: ]: if pin > 0: logger.info("Writing value=0 to pin=%d (%s)", pin, key) - gpio.write(pin, False) + gpio.set_output(pin, initial=False) - logger.info("Trying to find and kill mjpg_streamer ...") + streamer = os.path.basename(config["video"]["cmd"][0]) + logger.info("Trying to find and kill %r ...", streamer) try: - subprocess.check_output(["killall", "mjpg_streamer"], stderr=subprocess.STDOUT) + subprocess.check_output(["killall", streamer], stderr=subprocess.STDOUT) time.sleep(3) - subprocess.check_output(["killall", "-9", "mjpg_streamer"], stderr=subprocess.STDOUT) + subprocess.check_output(["killall", "-9", streamer], stderr=subprocess.STDOUT) except subprocess.CalledProcessError: pass |