Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
Bryan Frimin
2026-05-26 10:31:37 -07:00
parent e040851a4c
commit 7a3d3db7ac
13 changed files with 125 additions and 0 deletions

View File

@@ -70,6 +70,7 @@ func Install(cfg Config) error {
}
defer func() { _ = f.Close() }()
if err := tmpl.Execute(f, cfg); err != nil {
return fmt.Errorf("cannot render systemd unit: %w", err)
}
@@ -87,6 +88,7 @@ func Install(cfg Config) error {
func Uninstall(cfg Config) error {
_ = exec.Command("systemctl", "disable", "--now", "probo-agent.service").Run()
if err := os.Remove(systemdUnitPath); err != nil && !errors.Is(err, os.ErrNotExist) {
return fmt.Errorf("cannot remove systemd unit: %w", err)
}