feat(cmd): add start, stop, uninstall, and update commands

This commit is contained in:
Hein
2026-04-08 13:36:32 +02:00
parent 168b81f104
commit 880023c68b
5 changed files with 234 additions and 0 deletions

View File

@@ -73,6 +73,16 @@ func Disable(u config.Unit, prefix, suffix string) error {
return systemctl(u.User, "disable", "--now", ServiceName(u, prefix, suffix))
}
// Start starts a unit without enabling it.
func Start(u config.Unit, prefix, suffix string) error {
return systemctl(u.User, "start", ServiceName(u, prefix, suffix))
}
// Stop stops a unit without disabling it.
func Stop(u config.Unit, prefix, suffix string) error {
return systemctl(u.User, "stop", ServiceName(u, prefix, suffix))
}
// Status returns the ActiveState of a unit ("active", "inactive", "failed", "unknown").
func Status(u config.Unit, prefix, suffix string) string {
args := []string{"show", "-p", "ActiveState", "--value", ServiceName(u, prefix, suffix)}