phpmyadmin优化

pull/116/head
midoks 3 years ago
parent a085551d34
commit 3825e78cd0
  1. 4
      plugins/phpmyadmin/index.py
  2. 29
      plugins/phpmyadmin/install.sh

@ -108,7 +108,9 @@ def contentReplace(content):
def status():
conf = getConf()
if os.path.exists(conf):
conf_inc = getServerDir() + '/phpmyadmin/config.inc.php'
# 两个文件都在,才算启动成功
if os.path.exists(conf) and os.path.exists(conf_inc):
return 'start'
return 'stop'

@ -9,6 +9,26 @@ serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/mw_install.pl
sysName=`uname`
echo "use system: ${sysName}"
if [ ${sysName} == "Darwin" ]; then
OSNAME='macos'
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
OSNAME='centos'
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
OSNAME='fedora'
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
OSNAME='debian'
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
OSNAME='ubuntu'
elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
OSNAME='raspbian'
else
OSNAME='unknow'
fi
Install_phpmyadmin()
{
mkdir -p ${serverPath}/phpmyadmin
@ -32,15 +52,22 @@ Install_phpmyadmin()
cd $serverPath/phpmyadmin/ && mv $FDIR phpmyadmin
mkdir -p $serverPath/phpmyadmin/tmp
chown -R www:www $serverPath/phpmyadmin/tmp
if [ "$OSNAME" == 'macosx' ];then
chown -R www:www $serverPath/phpmyadmin/tmp
fi
echo "${1}" > ${serverPath}/phpmyadmin/version.pl
echo '安装完成' > $install_tmp
cd ${rootPath} && python3 ${rootPath}/plugins/phpmyadmin/index.py start
}
Uninstall_phpmyadmin()
{
cd ${rootPath} && python3 ${rootPath}/plugins/phpmyadmin/index.py stop
rm -rf ${serverPath}/phpmyadmin
echo '卸载完成' > $install_tmp
}

Loading…
Cancel
Save