From e490c7546f33b66f9db19a6248196bd1b2eb6fd9 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 7 Jul 2022 18:08:05 +0800 Subject: [PATCH] up --- plugins/php-yum/index.py | 12 ++++++------ plugins/php-yum/versions/common.sh | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 plugins/php-yum/versions/common.sh diff --git a/plugins/php-yum/index.py b/plugins/php-yum/index.py index 668c708d4..7daa3450a 100755 --- a/plugins/php-yum/index.py +++ b/plugins/php-yum/index.py @@ -591,11 +591,11 @@ def installLib(version): return data[1] name = args['name'] - execstr = "cd " + getPluginDir() + '/versions/' + version + " && /bin/bash " + \ - name + '.sh' + ' install ' + version + execstr = "cd " + getPluginDir() + '/versions/' + version + \ + " && /bin/bash common.sh " + version + ' install ' + name rettime = time.strftime('%Y-%m-%d %H:%M:%S') - insert_info = (None, '安装[' + name + '-' + version + ']', + insert_info = (None, '安装PHPYUM[' + name + '-' + version + ']', 'execshell', '0', rettime, execstr) mw.M('tasks').add('id,name,type,status,addtime,execstr', insert_info) @@ -610,15 +610,15 @@ def uninstallLib(version): return data[1] name = args['name'] - execstr = "cd " + getPluginDir() + '/versions/' + version + " && /bin/bash " + \ - name + '.sh' + ' uninstall ' + version + execstr = "cd " + getPluginDir() + '/versions/' + version + \ + " && /bin/bash common.sh " + version + ' uninstall ' + name data = mw.execShell(execstr) # data[0] == '' and if data[1] == '': return mw.returnJson(True, '已经卸载成功!') else: - return mw.returnJson(False, '卸载信息![通道0]:' + data[0] + "[通道0]:" + data[1]) + return mw.returnJson(False, '卸载错误信息!:' + data[1]) def installPreInspection(version): diff --git a/plugins/php-yum/versions/common.sh b/plugins/php-yum/versions/common.sh new file mode 100644 index 000000000..7632557b5 --- /dev/null +++ b/plugins/php-yum/versions/common.sh @@ -0,0 +1,14 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") + +version=$1 +action=$2 + +echo $1,$2