This commit is contained in:
parent
98f27498b0
commit
c8aa91cfa3
|
|
@ -190,6 +190,10 @@ class App:
|
|||
|
||||
return file_agent_bin
|
||||
|
||||
def init_cfg(self):
|
||||
self.initDreplace()
|
||||
self.initDAgent()
|
||||
|
||||
def imOp(self, method):
|
||||
|
||||
file = self.initDreplace()
|
||||
|
|
|
|||
|
|
@ -23,3 +23,21 @@ if [ ! -d $curPath/versions/$2 ];then
|
|||
fi
|
||||
|
||||
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
|
||||
echo "$VERSION" > $serverPath/nezha/version.pl
|
||||
|
||||
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py start
|
||||
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py initd_install
|
||||
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py init_cfg
|
||||
fi
|
||||
echo 'install successful' > $install_tmp
|
||||
}
|
||||
|
|
@ -142,7 +140,9 @@ Install_App()
|
|||
Uninstall_App()
|
||||
{
|
||||
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_agent
|
||||
rm -rf $serverPath/nezha
|
||||
echo "install fail" > $install_tmp
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue