Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrohy committed Feb 18, 2022
1 parent 48e289a commit d1588bd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions util/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit d1588bd

Please sign in to comment.