Renamed services again after re-save to the wrong name.

This commit is contained in:
Anton Hvornum 2020-09-01 14:43:04 +02:00
parent 99dcdc357f
commit 1cdd96f9aa
2 changed files with 1 additions and 14 deletions

View File

@ -4,7 +4,7 @@ from .exceptions import *
from .general import *
def service_state(service_name :str):
if os.path.fileext(service_name)[1] != '.service':
if os.path.splitext(service_name)[1] != '.service':
service_name += '.service' # Just to be safe
state = b''.join(sys_command(f'systemctl show -p SubState --value {service_name}'))

View File

@ -1,13 +0,0 @@
import os
from .exceptions import *
from .general import *
def service_state(service_name :str):
if os.path.splitext(service_name)[1] != '.service':
service_name += '.service' # Just to be safe
state = b''.join(sys_command(f'systemctl show -p SubState --value {service_name}'))
return state.decode('UTF-8')