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

Method IsActive

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

Source from the content-addressed store, hash-verified

19}
20
21func (s *Snap) IsActive(serviceName string) bool {
22 out, err := run(s.toolCmd, "services")
23 if err != nil {
24 return false
25 }
26 lines := strings.Split(out, "\n")
27 for _, line := range lines {
28 if strings.Contains(line, serviceName) && strings.Contains(line, "active") {
29 return true
30 }
31 }
32 return false
33}
34
35func (s *Snap) IsEnable(serviceName string) bool {
36 out, err := run(s.toolCmd, "services")

Callers

nothing calls this directly

Calls 1

runFunction · 0.70

Tested by

no test coverage detected