added option to detect if running on snap
This commit is contained in:
parent
ee813abfdd
commit
c78ea8dd59
|
@ -4,6 +4,7 @@
|
||||||
#
|
#
|
||||||
# Blog post: http://foolcontrol.org/?p=3124
|
# Blog post: http://foolcontrol.org/?p=3124
|
||||||
|
|
||||||
|
# core import
|
||||||
import sys
|
import sys
|
||||||
sys.path.append('../')
|
sys.path.append('../')
|
||||||
from source.core import *
|
from source.core import *
|
||||||
|
|
|
@ -31,10 +31,6 @@ parts:
|
||||||
source: scripts
|
source: scripts
|
||||||
organize:
|
organize:
|
||||||
cpufreqctl.sh: usr/bin/cpufreqctl
|
cpufreqctl.sh: usr/bin/cpufreqctl
|
||||||
# organize:
|
|
||||||
# auto-cpufreq-install.sh: usr/bin/auto-cpufreq-install
|
|
||||||
# organize:
|
|
||||||
# auto-cpufreq-remove.sh: usr/bin/auto-cpufreq-remove
|
|
||||||
|
|
||||||
apps:
|
apps:
|
||||||
auto-cpufreq:
|
auto-cpufreq:
|
||||||
|
@ -42,3 +38,4 @@ apps:
|
||||||
environment:
|
environment:
|
||||||
LC_ALL: C.UTF-8
|
LC_ALL: C.UTF-8
|
||||||
LANG: C.UTF-8
|
LANG: C.UTF-8
|
||||||
|
PKG_MARKER: SNAP
|
|
@ -37,11 +37,15 @@ auto_cpufreq_log_file = "/var/log/auto-cpufreq.log"
|
||||||
|
|
||||||
# deploy cpufreqctl script
|
# deploy cpufreqctl script
|
||||||
def cpufreqctl():
|
def cpufreqctl():
|
||||||
# deploy cpufreqctl script (if missing)
|
# detect if running on a SNAP
|
||||||
if os.path.isfile("/usr/bin/cpufreqctl"):
|
if os.getenv('PKG_MARKER') == "SNAP":
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
os.system("cp scripts/cpufreqctl.sh /usr/bin/cpufreqctl")
|
# deploy cpufreqctl script (if missing)
|
||||||
|
if os.path.isfile("/usr/bin/cpufreqctl"):
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
os.system("cp scripts/cpufreqctl.sh /usr/bin/cpufreqctl")
|
||||||
|
|
||||||
def footer(l):
|
def footer(l):
|
||||||
print("\n" + "-" * l + "\n")
|
print("\n" + "-" * l + "\n")
|
||||||
|
|
Loading…
Reference in New Issue