|
|
@ -18,6 +18,17 @@ else |
|
|
|
useradd -g www -s /bin/bash www |
|
|
|
useradd -g www -s /bin/bash www |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_os=`uname` |
|
|
|
|
|
|
|
if [ ${_os} == "Darwin" ]; then |
|
|
|
|
|
|
|
OSNAME='macos' |
|
|
|
|
|
|
|
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' |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
OSNAME='unknow' |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
action=$1 |
|
|
|
action=$1 |
|
|
|
type=$2 |
|
|
|
type=$2 |
|
|
|
|
|
|
|
|
|
|
@ -32,9 +43,13 @@ if [ ! -d $curPath/versions/$2 ];then |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$OSNAME" == "ubuntu" ];then |
|
|
|
|
|
|
|
echo "y" | add-apt-repository ppa:ondrej/php && apt update -y |
|
|
|
|
|
|
|
fi |
|
|
|
# apt install $(grep-aptavail -S PHP-defaults -s Package -n) |
|
|
|
# apt install $(grep-aptavail -S PHP-defaults -s Package -n) |
|
|
|
|
|
|
|
|
|
|
|
if [ ! -f /etc/apt/sources.list.d/php.list ];then |
|
|
|
if [ ! -f /etc/apt/sources.list.d/php.list ] && [ "$OSNAME" == "debian" ];then |
|
|
|
# install php source |
|
|
|
# install php source |
|
|
|
|
|
|
|
|
|
|
|
apt update -y |
|
|
|
apt update -y |
|
|
@ -46,7 +61,6 @@ apt update -y |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "${action}" == "uninstall" ] && [ -d ${serverPath}/php-apt/${type} ];then |
|
|
|
if [ "${action}" == "uninstall" ] && [ -d ${serverPath}/php-apt/${type} ];then |
|
|
|
#初始化 |
|
|
|
#初始化 |
|
|
|
cd ${rootPath} && python3 ${rootPath}/plugins/php-apt/index.py stop ${type} |
|
|
|
cd ${rootPath} && python3 ${rootPath}/plugins/php-apt/index.py stop ${type} |
|
|
|