Skip to content

Commit

Permalink
Update yunzai-bot.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
wangshengjj authored Apr 12, 2023
1 parent a08900f commit 237d5d2
Showing 1 changed file with 66 additions and 37 deletions.
103 changes: 66 additions & 37 deletions yunzai-bot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ echo "The Yum source is being configured, please wait patiently for a long time"
echo -e "正在配置Yum源 \e[31m时间较长请耐心等待\e[0m"
echo "==============================================================================================="
yum install -y wget &> /dev/null && yum install -y curl &> /dev/null
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo &> /dev/null && wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo &> /dev/null
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo && wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
echo "==============================================================================================="
echo "正在建立Yum缓存"
yum clean all &> /dev/null && yum makecache &> /dev/null
echo "==============================================================================================="
echo "Testing the Yum source"
echo "正在测试Yum源"
echo "==============================================================================================="
Expand All @@ -20,30 +23,67 @@ echo "Installing Chinese font dependencies"
echo "正在安装中文字体依赖"
echo "==============================================================================================="
yum groupinstall fonts -y &> /dev/null
echo "Installing Git"
echo "正在安装Git"
echo "==============================================================================================="
yum install -y git &> /dev/null
echo "Testing the Git environment"
echo "正在测试Git环境"
git version
echo "==============================================================================================="
echo "Installing Redis"
echo "正在安装Redis"
echo "==============================================================================================="
yum -y install redis &> /dev/null && redis-server --daemonize yes &> /dev/null
echo "Installing Nodejs16"
echo "正在安装Nodejs16"
echo "==============================================================================================="
curl -sL https://rpm.nodesource.com/setup_16.x | bash - &> /dev/null && yum -y install nodejs &> /dev/null
echo "Testing the Nodejs environment"
echo "正在测试Nodejs环境"
node -v && npm -v
echo "==============================================================================================="
echo "Installing Chromeium"
echo "正在安装Chromeium"
echo "==============================================================================================="
yum -y install chromium &> /dev/null
#检测git环境,并且安装
echo "正在检测Git环境"
echo "==============================================================================================="
if git --version &> /dev/null; then
echo "Git环境已经安装"
git --version
echo "==============================================================================================="
else
echo "正在安装Git"
yum install -y git &> /dev/null
echo "==============================================================================================="
echo "正在测试Git环境"
git --version
echo "==============================================================================================="
fi
#检测redis数据库,并且安装
echo "正在检测redis环境"
echo "==============================================================================================="
if redis-server --version &> /dev/null; then
echo "Redis环境已经安装"
redis-server --version
echo "==============================================================================================="
else
echo "正在安装Redis"
yum -y install redis &> /dev/null && redis-server --daemonize yes &> /dev/null
echo "==============================================================================================="
echo "正在测试Redis环境"
redis-server --version
echo "==============================================================================================="
fi
#检测Nodejs,并且安装
echo "正在检测Nodejs环境"
echo "==============================================================================================="
if node -v &> /dev/null; then
echo "Nodejs环境已经安装"
node -v && npm -v
echo "==============================================================================================="
else
echo "正在安装Nodejs"
curl -sL https://rpm.nodesource.com/setup_16.x | bash - &> /dev/null && yum -y install nodejs &> /dev/null
echo "==============================================================================================="
echo "正在测试Nodejs环境"
node -v && npm -v
echo "==============================================================================================="
fi
#检测Chromeium,并且安装
echo "正在检测Chromium环境"
echo "==============================================================================================="
if rpm -q chromium &> /dev/null; then
echo "Chromium环境已经安装"
rpm -q chromium
echo "==============================================================================================="
else
echo "正在安装Chromium"
yum -y install chromium &> /dev/null
echo "==============================================================================================="
echo "正在测试Chromium环境"
rpm -q chromium
echo "==============================================================================================="
fi

echo "Miao-YunZai-Bot is being cloned"
echo "正在克隆Miao-YunZai-Bot"
echo "==============================================================================================="
Expand All @@ -56,19 +96,8 @@ npm install pnpm -g &> /dev/null && pnpm install -P &> /dev/null
echo "Miao-YunZai-Bot has been installed! Looking forward to your next use! by@WangShengJJ"
echo 'Miao-YunZai-Bot已经安装完成! 期待您的下次使用! by@WangShengJJ'
echo "==============================================================================================="
echo "The bash will automatically start Miao-YunZai-Bot in 5 seconds!"
echo "The shell will automatically start Miao-YunZai-Bot in 5 seconds!"
echo '脚本将于5秒后自动启动Miao-YunZai-Bot!'
echo "==============================================================================================="
sleep 5s
node app











0 comments on commit 237d5d2

Please sign in to comment.