mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-21 14:38:15 +01:00
add shutil to autostart cmdline -> no need to enter pwd several times
This commit is contained in:
parent
e044545a5b
commit
0ec02447d5
1 changed files with 4 additions and 4 deletions
|
@ -157,9 +157,9 @@ class CraftBeerPiCli():
|
|||
destfile = os.path.join("/etc/systemd/system")
|
||||
shutil.os.system('sudo cp "{}" "{}"'.format(srcfile,destfile))
|
||||
print("Copied craftbeerpi.service to /etc/systemd/system")
|
||||
os.system('systemctl enable craftbeerpi.service')
|
||||
shutil.os.system('sudo systemctl enable craftbeerpi.service')
|
||||
print('Enabled craftbeerpi service')
|
||||
os.system('systemctl start craftbeerpi.service')
|
||||
shutil.os.system('sudo systemctl start craftbeerpi.service')
|
||||
print('Started craftbeerpi.service')
|
||||
else:
|
||||
print("craftbeerpi.service is already located in /etc/systemd/system")
|
||||
|
@ -172,9 +172,9 @@ class CraftBeerPiCli():
|
|||
try:
|
||||
status = os.popen('systemctl list-units --type=service --state=running | grep craftbeerpi.service').read()
|
||||
if status.find("craftbeerpi.service") != -1:
|
||||
os.system('systemctl stop craftbeerpi.service')
|
||||
shutil.os.system('sudo systemctl stop craftbeerpi.service')
|
||||
print('Stopped craftbeerpi service')
|
||||
os.system('systemctl disable craftbeerpi.service')
|
||||
shutil.os.system('sudo systemctl disable craftbeerpi.service')
|
||||
print('Removed craftbeerpi.service as service')
|
||||
else:
|
||||
print('craftbeerpi.service service is not running')
|
||||
|
|
Loading…
Reference in a new issue