Files
dns_service/utils/restart_dnsmasq.go
T
2025-06-26 18:20:20 +07:00

18 lines
325 B
Go

package utils
import (
"os"
"os/exec"
)
func RestartDnsmasq() {
switch os.Getenv("SYSTEM_INITIALIZATION") {
case "rc":
exec.Command("rc", "restart", "dnsmasq").Run()
case "openrc":
exec.Command("rc-service", "dnsmasq", "restart").Run()
case "systemd":
exec.Command("systemctl", "restart", "dnsmasq").Run()
}
}