diff --git a/plugins/nezha/index.py b/plugins/nezha/index.py index f51d549a3..3481ac1a8 100755 --- a/plugins/nezha/index.py +++ b/plugins/nezha/index.py @@ -192,10 +192,6 @@ class App: def imOp(self, method): - path = self.__agent_cfg - if not os.path.exists(path): - return '请先设置Agent配置!' - file = self.initDreplace() if not mw.isAppleSystem(): @@ -225,6 +221,10 @@ class App: def agOp(self, method): file = self.initDAgent() + path = self.__agent_cfg + if not os.path.exists(path): + return '请先设置Agent配置!' + if not mw.isAppleSystem(): cmd = 'systemctl {} {}'.format(method, 'nezha-agent') data = mw.execShell(cmd)