pull/420/head
midoks 2 years ago
parent 98f27498b0
commit c8aa91cfa3
  1. 4
      plugins/nezha/index.py
  2. 18
      plugins/nezha/install.sh
  3. 6
      plugins/nezha/versions/0.15.2/install.sh

@ -190,6 +190,10 @@ class App:
return file_agent_bin return file_agent_bin
def init_cfg(self):
self.initDreplace()
self.initDAgent()
def imOp(self, method): def imOp(self, method):
file = self.initDreplace() file = self.initDreplace()

@ -23,3 +23,21 @@ if [ ! -d $curPath/versions/$2 ];then
fi fi
sh -x $curPath/versions/$2/install.sh $1 sh -x $curPath/versions/$2/install.sh $1
if [ "${action}" == "uninstall" ];then
if [ -f /usr/lib/systemd/system/nezha.service ] || [ -f /lib/systemd/system/nezha.service ] ;then
systemctl stop nezha
systemctl disable nezha
rm -rf /usr/lib/systemd/system/nezha.service
rm -rf /lib/systemd/system/nezha.service
systemctl daemon-reload
fi
if [ -f /usr/lib/systemd/system/nezha-agent.service ] || [ -f /lib/systemd/system/nezha-agent.service ] ;then
systemctl stop nezha-agent
systemctl disable nezha-agent
rm -rf /usr/lib/systemd/system/nezha-agent.service
rm -rf /lib/systemd/system/nezha-agent.service
systemctl daemon-reload
fi
fi

@ -132,9 +132,7 @@ Install_App()
if [ -d $serverPath/nezha ];then if [ -d $serverPath/nezha ];then
echo "$VERSION" > $serverPath/nezha/version.pl echo "$VERSION" > $serverPath/nezha/version.pl
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py init_cfg
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py start
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py initd_install
fi fi
echo 'install successful' > $install_tmp echo 'install successful' > $install_tmp
} }
@ -142,7 +140,9 @@ Install_App()
Uninstall_App() Uninstall_App()
{ {
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py initd_uninstall cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py initd_uninstall
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py initd_uninstall_agent
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py stop cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py stop
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py stop_agent
rm -rf $serverPath/nezha rm -rf $serverPath/nezha
echo "install fail" > $install_tmp echo "install fail" > $install_tmp
} }

Loading…
Cancel
Save