MCPcopy Index your code
hub / github.com/1Panel-dev/1Panel / IsExist

Method IsExist

core/utils/controller/manager/systemd.go:46–58  ·  view source on GitHub ↗
(serviceName string)

Source from the content-addressed store, hash-verified

44}
45
46func (s *Systemd) IsExist(serviceName string) (bool, error) {
47 out, err := run(s.Client, s.toolCmd, "is-enabled", serviceName)
48 if err != nil && out != "enabled\n" {
49 if strings.Contains(out, "disabled") {
50 return true, err
51 }
52 if NewSnap().IsExist(serviceName) {
53 return true, nil
54 }
55 return false, err
56 }
57 return true, err
58}
59
60func (s *Systemd) Status(serviceName string) (string, error) {
61 return run(s.Client, s.toolCmd, "status", serviceName)

Callers

nothing calls this directly

Calls 3

runFunction · 0.70
NewSnapFunction · 0.70
IsExistMethod · 0.65

Tested by

no test coverage detected