piframe-go/utils/systemd.go

24 lines
425 B
Go

package utils
import (
"log"
"os/exec"
)
const (
CMD_SYSTEMCTL = "/usr/bin/systemctl"
)
const (
SCREEN_ON_TIMER_PATH = "/etc/systemd/system/screen-on.timer"
SCREEN_OFF_TIMER_PATH = "/etc/systemd/system/screen-off.timer"
)
func SystemdDaemonReload() {
// Reload systemd units
err := exec.Command(CMD_SYSTEMCTL, "daemon-reload").Run()
if err != nil {
log.Fatalf("Error running %s : %s", CMD_SYSTEMCTL, err)
}
}