mdserver-web/plugins/php/install.sh

35 lines
720 B
Bash
Raw Normal View History

2018-10-07 06:51:52 -04:00
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
2018-11-26 00:57:06 -05:00
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
2019-03-13 05:19:33 -04:00
install_tmp=${rootPath}/tmp/mw_install.pl
2018-11-26 00:57:06 -05:00
2022-06-10 05:53:23 -04:00
if id www &> /dev/null ;then
echo "www UID is `id -u www`"
echo "www Shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
else
groupadd www
# useradd -g www -s /sbin/nologin www
useradd -g www -s /bin/bash www
fi
2018-10-07 06:51:52 -04:00
2018-11-27 00:17:06 -05:00
action=$1
type=$2
2018-10-07 06:51:52 -04:00
2018-11-27 00:17:06 -05:00
if [ "${2}" == "" ];then
echo '缺少安装脚本...' > $install_tmp
exit 0
fi
2018-10-07 06:51:52 -04:00
2018-11-27 00:17:06 -05:00
if [ ! -d $curPath/versions/$2 ];then
echo '缺少安装脚本2...' > $install_tmp
2018-11-27 01:37:24 -05:00
exit 0
2018-10-07 06:51:52 -04:00
fi
2018-11-27 00:17:06 -05:00
2018-11-27 06:20:46 -05:00
sh -x $curPath/versions/$2/install.sh $1