Add support for timers

This commit is contained in:
dalto 2021-10-26 16:05:49 -05:00
parent c2c55f03c9
commit a1699e28a2
2 changed files with 7 additions and 0 deletions

View File

@ -63,6 +63,8 @@ def systemctl(targets, command, suffix):
description = _("Cannot enable systemd service <code>{name!s}</code>.")
elif command == "enable" and suffix == ".target":
description = _("Cannot enable systemd target <code>{name!s}</code>.")
elif command == "enable" and suffix == ".timer":
description = _("Cannot enable systemd timer <code>{name!s}</code>.")
elif command == "disable" and suffix == ".service":
description = _("Cannot enable systemd service <code>{name!s}</code>.")
elif command == "disable" and suffix == ".target":
@ -97,6 +99,10 @@ def run():
if r is not None:
return r
r = systemctl(cfg.get("timers", []), "enable", ".timer")
if r is not None:
return r
r = systemctl(cfg.get("disable", []), "disable", ".service")
if r is not None:
return r

View File

@ -68,6 +68,7 @@
# By default, no changes are made.
services: []
targets: []
timers: []
disable: []
disable-targets: []
mask: []