Update install.sh

This commit is contained in:
midoks 2019-04-21 18:27:47 +08:00
parent 954df1b522
commit 19911de04f
1 changed files with 22 additions and 17 deletions

View File

@ -8,25 +8,30 @@ rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/mw_install.pl
Install_of(){
mkdir -p $serverPath/op_firewall
echo '正在安装脚本文件...' > $install_tmp
echo '0.1' > $serverPath/op_firewall/version.pl
echo 'install ok' > $install_tmp
}
Uninstall_of(){
rm -rf $serverPath/op_firewall
}
action=$1
type=$2
if id www &> /dev/null ;then
echo "www UID is `id -u www`"
echo "www Shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
action=$1
if [ "${1}" == 'install' ];then
Install_of
else
groupadd www
useradd -g www -s /sbin/nologin www
Uninstall_of
fi
if [ "${2}" == "" ];then
echo '缺少安装脚本...' > $install_tmp
exit 0
fi
if [ ! -d $curPath/versions/$2 ];then
echo '缺少安装脚本2...' > $install_tmp
exit 0
fi
sh -x $curPath/versions/$2/install.sh $1