(name)
Check if a service is enabled
Check if a service is enabled
Check if a service is enabled
def check_service_enabled(name):
    """
    Check if a service is enabled
    """
    try:
        subprocess.run(["systemctl", "is-enabled", name], check=True)
        return True
    except subprocess.CalledProcessError:
        return False
def check_service_enabled ( name ) : try : subprocess . run ( [ "systemctl" , "is-enabled" , name ] , check = True ) return True except subprocess . CalledProcessError : return False