diff --git a/util/command.go b/util/command.go index 40e32e3c..7c4edc15 100644 --- a/util/command.go +++ b/util/command.go @@ -69,10 +69,7 @@ func SystemctlEnable(name string) { func SystemctlStatus(name string) string { out, err := exec.Command("bash", "-c", fmt.Sprintf("systemctl status %s", name)).CombinedOutput() if v, _ := systemctlReplace(err); v { - out, err = exec.Command("bash", "-c", fmt.Sprintf("systemctl status %s", name)).CombinedOutput() - } - if err != nil { - fmt.Println(Red(fmt.Sprintf("查看%s状态失败!", name))) + out, _ = exec.Command("bash", "-c", fmt.Sprintf("systemctl status %s", name)).CombinedOutput() } return string(out) }