From 16bc315da23b6de47a7b3b4e5411a50e6fc913d8 Mon Sep 17 00:00:00 2001 From: Adnan Hodzic Date: Sat, 8 Feb 2020 20:35:39 +0100 Subject: [PATCH] extended disable running multiple instances functionality to snap --- bin/auto-cpufreq | 8 ++++---- source/core.py | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/auto-cpufreq b/bin/auto-cpufreq index 86e0090..9aa950b 100755 --- a/bin/auto-cpufreq +++ b/bin/auto-cpufreq @@ -57,7 +57,7 @@ def main(monitor, live, daemon, install, log): elif monitor: while True: root_check() - running_daemon() # doesn't work on snap + running_daemon() gov_check() cpufreqctl() sysinfo() @@ -67,7 +67,7 @@ def main(monitor, live, daemon, install, log): elif live: while True: root_check() - running_daemon() # doesn't work on snap + running_daemon() gov_check() cpufreqctl() sysinfo() @@ -80,14 +80,14 @@ def main(monitor, live, daemon, install, log): elif install: if os.getenv('PKG_MARKER') == "SNAP": root_check() - running_daemon() # doesn't work on snap + running_daemon() gov_check() s.run("snapctl set daemon=enabled", shell=True) s.run("snapctl start --enable auto-cpufreq", shell=True) deploy_complete_msg() else: root_check() - running_daemon() # doesn't work on snap + running_daemon() gov_check() deploy() deploy_complete_msg() diff --git a/source/core.py b/source/core.py index a867f20..b898980 100644 --- a/source/core.py +++ b/source/core.py @@ -412,5 +412,8 @@ def is_running(program, argument): # check if auto-cpufreq --daemon is running def running_daemon(): if is_running('auto-cpufreq', '--daemon'): + deploy_complete_msg() + exit(1) + elif os.getenv("PKG_MARKER") == "SNAP" and dcheck == "enabled": deploy_complete_msg() exit(1) \ No newline at end of file