|
|
@ -192,10 +192,6 @@ class App: |
|
|
|
|
|
|
|
|
|
|
|
def imOp(self, method): |
|
|
|
def imOp(self, method): |
|
|
|
|
|
|
|
|
|
|
|
path = self.__agent_cfg |
|
|
|
|
|
|
|
if not os.path.exists(path): |
|
|
|
|
|
|
|
return '请先设置Agent配置!' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
file = self.initDreplace() |
|
|
|
file = self.initDreplace() |
|
|
|
|
|
|
|
|
|
|
|
if not mw.isAppleSystem(): |
|
|
|
if not mw.isAppleSystem(): |
|
|
@ -225,6 +221,10 @@ class App: |
|
|
|
def agOp(self, method): |
|
|
|
def agOp(self, method): |
|
|
|
file = self.initDAgent() |
|
|
|
file = self.initDAgent() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
path = self.__agent_cfg |
|
|
|
|
|
|
|
if not os.path.exists(path): |
|
|
|
|
|
|
|
return '请先设置Agent配置!' |
|
|
|
|
|
|
|
|
|
|
|
if not mw.isAppleSystem(): |
|
|
|
if not mw.isAppleSystem(): |
|
|
|
cmd = 'systemctl {} {}'.format(method, 'nezha-agent') |
|
|
|
cmd = 'systemctl {} {}'.format(method, 'nezha-agent') |
|
|
|
data = mw.execShell(cmd) |
|
|
|
data = mw.execShell(cmd) |
|
|
|