18 lines
325 B
Go
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()
|
|
}
|
|
}
|