mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 04:19:26 +08:00
卸载软件功能优化
This commit is contained in:
+29
-10
@@ -115,7 +115,7 @@ class plugins_api:
|
||||
public.M('tasks').add('id,name,type,status,addtime, execstr', taskAdd)
|
||||
return public.returnJson(True, '已将安装任务添加到队列!')
|
||||
|
||||
def uninstallApi(self):
|
||||
def uninstallOldApi(self):
|
||||
rundir = public.getRunDir()
|
||||
name = request.form.get('name', '')
|
||||
version = request.form.get('version', '')
|
||||
@@ -142,6 +142,34 @@ class plugins_api:
|
||||
public.M('tasks').add('id,name,type,status,addtime, execstr', taskAdd)
|
||||
return public.returnJson(True, '已将卸载任务添加到队列!')
|
||||
|
||||
# 卸载时间短,不加入任务中...
|
||||
def uninstallApi(self):
|
||||
rundir = public.getRunDir()
|
||||
name = request.form.get('name', '')
|
||||
version = request.form.get('version', '')
|
||||
if name.strip() == '':
|
||||
return public.returnJson(False, "缺少插件名称!", ())
|
||||
|
||||
if version.strip() == '':
|
||||
return public.returnJson(False, "缺少版本信息!", ())
|
||||
|
||||
infoJsonPos = self.__plugin_dir + '/' + name + '/' + 'info.json'
|
||||
|
||||
if not os.path.exists(infoJsonPos):
|
||||
return public.retJson(False, "配置文件不存在!", ())
|
||||
|
||||
pluginInfo = json.loads(public.readFile(infoJsonPos))
|
||||
|
||||
execstr = "cd " + os.getcwd() + "/plugins/" + \
|
||||
name + " && /bin/bash " + pluginInfo["shell"] \
|
||||
+ " uninstall " + version
|
||||
|
||||
data = public.execShell(execstr)
|
||||
if data[1] == '':
|
||||
return public.returnJson(True, '已将卸载成功!')
|
||||
else:
|
||||
return public.returnJson(False, '卸载出现错误信息!' + data[1])
|
||||
|
||||
def checkApi(self):
|
||||
name = request.form.get('name', '')
|
||||
if name.strip() == '':
|
||||
@@ -786,12 +814,3 @@ class plugins_api:
|
||||
print 'callback', eval_str
|
||||
|
||||
return (True, newRet)
|
||||
|
||||
# 由于内容太大无法shell输出,暂时移动的插件模块中
|
||||
def phpinfoApi(self):
|
||||
v = request.form.get('v', '')
|
||||
sys.path.append("plugins/php")
|
||||
|
||||
import index
|
||||
content = index.getPhpinfo(v)
|
||||
return content
|
||||
|
||||
@@ -38,7 +38,7 @@ Install_qbittorrent()
|
||||
Uninstall_qbittorrent()
|
||||
{
|
||||
rm -rf $serverPath/qbittorrent
|
||||
yum -y remove qbittorrent-nox
|
||||
which yum && yum -y remove qbittorrent-nox
|
||||
echo "Uninstall_qbittorrent" > $install_tmp
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user