diff --git a/stages/io.weldr.systemd b/stages/io.weldr.systemd index 5278ffeb..f32000db 100755 --- a/stages/io.weldr.systemd +++ b/stages/io.weldr.systemd @@ -1,16 +1,23 @@ #!/usr/bin/python3 import json -import os import subprocess import sys + def main(tree, options): enabled_services = options["enabled_services"] + disabled_services = options.get("disabled_services", []) for service in enabled_services: subprocess.run([f"systemctl", "--root", tree, "enable", service], check=True) + for service in disabled_services: + subprocess.run([f"systemctl", "--root", tree, "disable", service], check=True) + + return 0 + + if __name__ == '__main__': args = json.load(sys.stdin) r = main(args["tree"], args["options"])