1
0
mirror of https://github.com/Foltik/dotfiles synced 2024-11-24 04:22:50 -05:00
dotfiles/lib/systemd.py

11 lines
261 B
Python
Raw Normal View History

2018-12-10 21:05:23 -05:00
import lib.proc as proc
def enable(unit, user):
flags = (['--user'] if user else []) + ['enable', unit]
output = systemd(flags)
def systemd(flags):
cmd = ['systemctl'] + flags
subproc = proc.exec(cmd)
return proc.communicate(subproc, cmd)