MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / IsEnable

Method IsEnable

agent/utils/controller/manager/snap.go:35–47  ·  view source on GitHub ↗
(serviceName string)

Source from the content-addressed store, hash-verified

33}
34
35func (s *Snap) IsEnable(serviceName string) bool {
36 out, err := run(s.toolCmd, "services")
37 if err != nil {
38 return false
39 }
40 lines := strings.Split(out, "\n")
41 for _, line := range lines {
42 if strings.Contains(line, serviceName) && strings.Contains(line, "enabled") {
43 return true
44 }
45 }
46 return false
47}
48
49func (s *Snap) Operate(operate, serviceName string) error {
50 if s.IsExist(serviceName) {

Callers

nothing calls this directly

Calls 1

runFunction · 0.70

Tested by

no test coverage detected