Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mdserver-web/plugins/php-apt/versions/common.sh

62 lines
1.1 KiB

3 years ago
#!/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
extName=$3
3 years ago
which bc
if [ "$?" != "0" ];then
apt install -y bc
fi
3 years ago
# echo $1,$2,$3
# echo $curPath
# echo $rootPath
# echo $serverPath
FILE=${curPath}/${version}/${extName}.sh
3 years ago
FILE_COMMON=${curPath}/common/${extName}.sh
3 years ago
3 years ago
# apt install -y php81-php-yar
3 years ago
3 years ago
3 years ago
if [ "$action" == 'install' ];then
if [ -f $FILE ];then
3 years ago
bash ${curPath}/${version}/${extName}.sh install $version
3 years ago
elif [ -f $FILE_COMMON ];then
bash ${FILE_COMMON} install ${version}
3 years ago
else
3 years ago
apt install -y php${version}-${extName}
3 years ago
fi
fi
3 years ago
# apt remove -y php81-php-yar
3 years ago
if [ "$action" == 'uninstall' ];then
if [ -f $FILE ];then
3 years ago
bash ${curPath}/${version}/${extName}.sh uninstall $version
3 years ago
elif [ -f $FILE_COMMON ];then
bash ${FILE_COMMON} uninstall ${version}
3 years ago
else
3 years ago
apt remove -y php${version}-${extName}
3 years ago
fi
fi
3 years ago
echo "apt install -y php${version}-${extName}"
echo "apt remove -y php${version}-${extName}"
3 years ago