feat(脚本): 完善内容

pull/534/merge
mack-a 2020-09-02 16:48:05 +08:00
parent 1af2b398b8
commit 1b911b609d
3 changed files with 250 additions and 161 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

View File

@ -9,8 +9,7 @@ add=
globalType= globalType=
customPath=alone customPath=alone
centosVersion=0 centosVersion=0
installProgress=0 totalProgress=
totalProgress=20
iplc=$1 iplc=$1
uuidws= uuidws=
uuidtcp= uuidtcp=
@ -23,11 +22,12 @@ function onCtrlC () {
} }
# echo颜色方法 # echo颜色方法
echoContent(){ echoContent(){
printN='\n' # printN=''
if [[ ! -z "$3" ]] # if [[ ! -z "$3" ]]
then # then
printN='' # echo 1
fi # printN='\n'
# fi
case $1 in case $1 in
# 红色 # 红色
"red") "red")
@ -35,7 +35,7 @@ echoContent(){
;; ;;
# 天蓝色 # 天蓝色
"skyBlue") "skyBlue")
${echoType} "\033[36m${printN}$2 \033[0m" ${echoType} "\033[1;36m${printN}$2 \033[0m"
;; ;;
# 绿色 # 绿色
"green") "green")
@ -59,15 +59,18 @@ echoContent(){
} }
# 新建目录 # 新建目录
mkdirTools(){ mkdirTools(){
echoContent skyBlue "\n进度 $1/${totalProgress} : 创建文件夹"
mkdir -p /etc/v2ray-agent/tls mkdir -p /etc/v2ray-agent/tls
mkdir -p /etc/v2ray-agent/v2ray mkdir -p /etc/v2ray-agent/v2ray
mkdir -p /etc/systemd/system/ mkdir -p /etc/systemd/system/
} }
# 安装工具包 # 安装工具包
installTools(){ installTools(){
echoContent skyBlue "\n进度 $1/${totalProgress} : 安装工具"
if [[ "${release}" = "centos" ]] if [[ "${release}" = "centos" ]]
then then
progressTools "yellow" "检查安装jq、nginx epel源、yum-utils--->" 0 echoContent green " ---> 检查安装jq、nginx epel源、yum-utils"
# progressTools "yellow" "检查安装jq、nginx epel源、yum-utils--->"
# jq epel源 # jq epel源
rpm -ivh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm > /dev/null 2>&1 rpm -ivh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm > /dev/null 2>&1
@ -152,75 +155,102 @@ installTools(){
# sed -i "${acmeBashrcLine}d" /root/.bashrc # sed -i "${acmeBashrcLine}d" /root/.bashrc
# fi # fi
echoContent green " ---> 检查、安装更新【新机器会很慢,耐心等待】"
progressTools "yellow" "检查、安装更新【新机器会很慢,耐心等待】--->" 5
# if [[ "${release}" = "centos" ]] # if [[ "${release}" = "centos" ]]
# then # then
# yum-complete-transaction --cleanup-only # yum-complete-transaction --cleanup-only
# fi # fi
${upgrade} > /dev/null ${upgrade} > /dev/null 2>&1
if [[ "${release}" = "centos" ]] if [[ "${release}" = "centos" ]]
then then
# yum要删除pid
rm -rf /var/run/yum.pid rm -rf /var/run/yum.pid
fi fi
# yum要删除pid
progressTools "yellow" "检查、安装wget--->" 6 if [[ -z `find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin |grep -v grep|grep wget` ]]
${installType} wget > /dev/null then
# progressTools "yellow" "安装wget--->"
echoContent green " ---> 安装wget"
${installType} wget > /dev/null
fi
progressTools "yellow" "检查、安装unzip--->" 7 if [[ -z `find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin |grep -v grep|grep unzip` ]]
${installType} unzip > /dev/null then
echoContent green " ---> 安装unzip"
# progressTools "yellow" "安装unzip--->"
${installType} unzip > /dev/null
fi
if [[ -z `find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin |grep -v grep|grep socat` ]]
then
# progressTools "yellow" "安装socat--->"
echoContent green " ---> 安装socat"
${installType} socat > /dev/null
fi
if [[ -z `find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin |grep -v grep|grep tar` ]]
then
# progressTools "yellow" "安装tar--->"
echoContent green " ---> 安装tar"
${installType} tar > /dev/null
fi
# echoContent yellow "检查、安装qrencode--->" # echoContent yellow "检查、安装qrencode--->"
# # progressTool qrencode & # # progressTool qrencode &
# ${installType} qrencode > /dev/null # ${installType} qrencode > /dev/null
if [[ -z `find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin |grep -v grep|grep cron` ]]
progressTools "yellow" "检查、安装socat--->" 8
${installType} socat > /dev/null
progressTools "yellow" "检查、安装tar--->" 9
${installType} tar > /dev/null
progressTools "yellow" "检查、安装crontabs--->" 10
if [[ "${release}" = "ubuntu" ]] || [[ "${release}" = "debian" ]]
then then
${installType} cron > /dev/null # progressTools "yellow" "安装crontabs--->"
else echoContent green " ---> 安装crontabs"
${installType} crontabs > /dev/null if [[ "${release}" = "ubuntu" ]] || [[ "${release}" = "debian" ]]
then
${installType} cron > /dev/null
else
${installType} crontabs > /dev/null
fi
fi
if [[ -z `find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin |grep -v grep|grep jq` ]]
then
echoContent green " ---> 安装jq"
# progressTools "yellow" "安装jq--->"
${installType} jq > /dev/null
fi fi
progressTools "yellow" "检查、安装jq--->" 11 if [[ -z `find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin |grep -v grep|grep binutils` ]]
${installType} jq > /dev/null then
echoContent green " ---> 安装binutils"
# progressTools "yellow" "安装binutils--->"
${installType} binutils > /dev/null 2>&1
fi
if [[ -z `find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin |grep -v grep|grep nginx` ]]
then
echoContent green " ---> 安装nginx"
# progressTools "yellow" "安装nginx--->"
${installType} nginx > /dev/null
fi
# echoContent skyBlue "检查、安装bind-utils--->"
# # progressTool bind-utils
# todo 关闭防火墙 # todo 关闭防火墙
# 安装nginx
progressTools "yellow" "检查、安装Nginx--->" 12
${installType} nginx > /dev/null
if [[ ! -z `ps -ef|grep -v grep|grep nginx` ]]
then
nginx -s stop
fi
progressTools "yellow" "检查、安装binutils--->" 13
${installType} binutils > /dev/null
# 新建所需目录 # 新建所需目录
# mkdirTools # mkdirTools
progressTools "yellow" "检查、安装acme--->" 14 if [[ -d "~/.acme.sh" ]] || [[ -z `ls -F ~/.acme.sh/|grep -w "acme.sh"` ]]
curl -s https://get.acme.sh | sh > /etc/tls/acme.log
if [[ -d "~/.acme.sh" ]] && [[ -z `ls -F ~/.acme.sh/|grep -w "acme.sh"` ]]
then then
echoContent red " acme安装失败--->" # progressTools "yellow" "安装acme.sh--->"
echoContent yellow "错误排查:" echoContent green " ---> 安装acme.sh"
echoContent red " 1.获取Github文件失败请等待GitHub恢复后尝试恢复进度可查看 [https://www.githubstatus.com/]" curl -s https://get.acme.sh | sh > /etc/tls/acme.log
echoContent red " 2.acme.sh脚本出现bug可查看[https://github.com/acmesh-official/acme.sh] issues" if [[ -d "~/.acme.sh" ]] && [[ -z `ls -F ~/.acme.sh/|grep -w "acme.sh"` ]]
echoContent red " 3.反馈给开发者[私聊https://t.me/mack_a] 或 [提issues]" then
killSleep > /dev/null 2>&1 echoContent red " acme安装失败--->"
exit 0 echoContent yellow "错误排查:"
echoContent red " 1.获取Github文件失败请等待GitHub恢复后尝试恢复进度可查看 [https://www.githubstatus.com/]"
echoContent red " 2.acme.sh脚本出现bug可查看[https://github.com/acmesh-official/acme.sh] issues"
echoContent red " 3.反馈给开发者[私聊https://t.me/mack_a] 或 [提issues]"
killSleep > /dev/null 2>&1
exit 0
fi
fi fi
} }
# 初始化Nginx申请证书配置 # 初始化Nginx申请证书配置
@ -228,7 +258,8 @@ initTLSNginxConfig(){
handleNginx stop handleNginx stop
killSleep > /dev/null 2>&1 killSleep > /dev/null 2>&1
killSleep > /dev/null 2>&1 killSleep > /dev/null 2>&1
echoContent green "初始化Nginx申请证书配置 --->" # echoContent green "初始化Nginx申请证书配置 --->"
echoContent skyBlue "\n进度 $1/${totalProgress} : 初始化Nginx申请证书配置"
echoContent yellow "请输入要配置的域名 例blog.v2ray-agent.com --->" echoContent yellow "请输入要配置的域名 例blog.v2ray-agent.com --->"
read -p "域名:" domain read -p "域名:" domain
if [[ -z ${domain} ]] if [[ -z ${domain} ]]
@ -237,18 +268,21 @@ initTLSNginxConfig(){
initTLSNginxConfig initTLSNginxConfig
else else
# 修改配置 # 修改配置
progressTools "yellow" "配置Nginx--->" 15 echoContent green " ---> 配置Nginx"
# progressTools "yellow" "配置Nginx--->" 15
touch /etc/nginx/conf.d/alone.conf touch /etc/nginx/conf.d/alone.conf
echo "server {listen 80;server_name ${domain};root /usr/share/nginx/html;location ~ /.well-known {allow all;}location /test {return 200 'fjkvymb6len';}}" > /etc/nginx/conf.d/alone.conf echo "server {listen 80;server_name ${domain};root /usr/share/nginx/html;location ~ /.well-known {allow all;}location /test {return 200 'fjkvymb6len';}}" > /etc/nginx/conf.d/alone.conf
# 启动nginx # 启动nginx
handleNginx start handleNginx start
# 测试nginx # 测试nginx
progressTools "yellow" "检查Nginx是否正常访问--->" 16 echoContent green " ---> 检查Nginx是否正常访问"
# progressTools "yellow" "检查Nginx是否正常访问--->" 16
domainResult=`curl -s ${domain}/test|grep fjkvymb6len` domainResult=`curl -s ${domain}/test|grep fjkvymb6len`
if [[ ! -z ${domainResult} ]] if [[ ! -z ${domainResult} ]]
then then
handleNginx stop handleNginx stop
progressTools "green" "Nginx配置成功--->" echoContent green " ---> Nginx配置成功"
# progressTools "green" "Nginx配置成功--->"
else else
echoContent red " 无法正常访问服务器请检测域名是否正确、域名的DNS解析以及防火墙设置是否正确--->" echoContent red " 无法正常访问服务器请检测域名是否正确、域名的DNS解析以及防火墙设置是否正确--->"
killSleep > /dev/null 2>&1 killSleep > /dev/null 2>&1
@ -258,10 +292,12 @@ initTLSNginxConfig(){
} }
# 安装TLS # 安装TLS
installTLS(){ installTLS(){
progressTools "yellow" "申请TLS证书" 17 # progressTools "yellow" "申请TLS证书" 17
echoContent skyBlue "\n进度 $1/${totalProgress} : 申请TLS证书"
if [[ -z `find /etc/v2ray-agent/tls/ -name "${domain}*"` ]] if [[ -z `find /etc/v2ray-agent/tls/ -name "${domain}*"` ]]
then then
progressTools "yellow" "检查、安装TLS证书--->" 17 echoContent green " ---> 安装TLS证书"
# progressTools "yellow" "安装TLS证书--->" 17
sudo ~/.acme.sh/acme.sh --issue -d ${domain} --standalone -k ec-256 >/dev/null sudo ~/.acme.sh/acme.sh --issue -d ${domain} --standalone -k ec-256 >/dev/null
~/.acme.sh/acme.sh --installcert -d ${domain} --fullchainpath /etc/v2ray-agent/tls/${domain}.crt --keypath /etc/v2ray-agent/tls/${domain}.key --ecc >/dev/null ~/.acme.sh/acme.sh --installcert -d ${domain} --fullchainpath /etc/v2ray-agent/tls/${domain}.crt --keypath /etc/v2ray-agent/tls/${domain}.key --ecc >/dev/null
@ -274,23 +310,30 @@ installTLS(){
progressTools "yellow" " TLS安装失败请检查acme日志--->" progressTools "yellow" " TLS安装失败请检查acme日志--->"
exit 0 exit 0
fi fi
progressTools "green" " TLS生成成功--->>" echoContent green " ---> TLS生成成功"
# progressTools "green" " TLS生成成功--->>"
# 记录证书生成的时间
echo ${domain} `date +%s` > /etc/v2ray-agent/tls/config echo ${domain} `date +%s` > /etc/v2ray-agent/tls/config
progressTools "yellow" " TLS证书备份成功证书位置/etc/v2ray-agent/tls--->"
elif [[ -z `cat /etc/v2ray-agent/tls/${domain}.crt` ]] || [[ -z `cat /etc/v2ray-agent/tls/${domain}.key` ]] elif [[ -z `cat /etc/v2ray-agent/tls/${domain}.crt` ]] || [[ -z `cat /etc/v2ray-agent/tls/${domain}.key` ]]
then then
progressTools "red" " 检测到错误证书,需重新生成,重新生成中--->" 18 progressTools "red" " 检测到错误证书,需重新生成,重新生成中--->" 18
rm -rf /etc/v2ray-agent/tls/ rm -rf /etc/v2ray-agent/tls/*
installTLS installTLS
else else
progressTools "yellow" "检测到证书,自动使用--->" echoContent green " ---> 检测到证书"
read -p "是否重新生成?[y/n]:" reInstalTLStatus
if [[ "${reInstalTLStatus}" = "y" ]]
then
rm -rf /etc/v2ray-agent/tls/*
installTLS $1
fi
# progressTools "yellow" "检测到证书,自动使用--->"
fi fi
} }
# 安装Nginx科学上网配置 # 安装Nginx科学上网配置
initNginxConfig(){ initNginxConfig(){
echoContent green "配置Nginx" echoContent skyBlue "\n进度 $2/${totalProgress} : 配置Nginx"
# echoContent green "配置Nginx"
installType=$1 installType=$1
if [[ "${installType}" = "wss" ]] if [[ "${installType}" = "wss" ]]
then then
@ -341,6 +384,7 @@ EOF
} }
# 自定义/随机路径 # 自定义/随机路径
randomPathFunction(){ randomPathFunction(){
echoContent skyBlue "\n进度 $1/${totalProgress} : 生成随机路径"
progressTools "yellow" "请输入自定义路径[例: alone],不需要斜杠,[回车]随机路径" progressTools "yellow" "请输入自定义路径[例: alone],不需要斜杠,[回车]随机路径"
read -p '路径:' customPath read -p '路径:' customPath
@ -352,11 +396,13 @@ randomPathFunction(){
} }
# Nginx伪装博客 # Nginx伪装博客
nginxBlog(){ nginxBlog(){
echoContent yellow "添加伪装博客--->" # echoContent yellow "添加伪装博客--->"
echoContent skyBlue "\n进度 $1/${totalProgress} : 添加伪装博客"
rm -rf /usr/share/nginx/html rm -rf /usr/share/nginx/html
wget -q -P /usr/share/nginx https://raw.githubusercontent.com/mack-a/v2ray-agent/master/blog/unable/html.zip > /dev/null wget -q -P /usr/share/nginx https://raw.githubusercontent.com/mack-a/v2ray-agent/master/blog/unable/html.zip > /dev/null
unzip /usr/share/nginx/html.zip -d /usr/share/nginx/html > /dev/null unzip /usr/share/nginx/html.zip -d /usr/share/nginx/html > /dev/null
echoContent yellow "添加伪装博客成功--->" # echoContent yellow "添加伪装博客成功--->"
echoContent green " ---> 添加伪装博客成功"
} }
# 操作Nginx # 操作Nginx
handleNginx(){ handleNginx(){
@ -375,7 +421,8 @@ handleNginx(){
} }
# 定时任务更新tls证书 # 定时任务更新tls证书
installCronTLS(){ installCronTLS(){
progressTools "yellow" "检查、添加定时维护证书--->" 19 echoContent skyBlue "\n进度 $1/${totalProgress} : 添加定时维护证书"
# progressTools "yellow" "检查、添加定时维护证书--->" 19
if [[ -z `crontab -l|grep -v grep|grep 'reloadInstallTLS'` ]] if [[ -z `crontab -l|grep -v grep|grep 'reloadInstallTLS'` ]]
then then
crontab -l >> /etc/v2ray-agent/backup_crontab.cron crontab -l >> /etc/v2ray-agent/backup_crontab.cron
@ -415,12 +462,14 @@ EOF
if [[ ! -z `crontab -l|grep -v grep|grep 'reloadInstallTLS'` ]] if [[ ! -z `crontab -l|grep -v grep|grep 'reloadInstallTLS'` ]]
then then
progressTools "green" " 添加定时维护证书成功" echoContent green " ---> 添加定时维护证书成功"
# progressTools "green" " 添加定时维护证书成功"
else else
crontab -l >> /etc/v2ray-agent/backup_crontab.cron crontab -l >> /etc/v2ray-agent/backup_crontab.cron
# 定时任务 # 定时任务
crontab /etc/v2ray-agent/backup_crontab.cron crontab /etc/v2ray-agent/backup_crontab.cron
progressTools "green" " 检测到已添加定时任务" # progressTools "green" " 检测到已添加定时任务"
echoContent green " ---> 添加定时维护证书成功"
fi fi
} }
# 安装V2Ray # 安装V2Ray
@ -428,30 +477,34 @@ installV2Ray(){
# ls -F /usr/bin/v2ray/|grep "v2ray" # ls -F /usr/bin/v2ray/|grep "v2ray"
# mkdir -p /usr/bin/v2ray/ # mkdir -p /usr/bin/v2ray/
# mkdir -p /etc/v2ray-agent/v2ray/ # mkdir -p /etc/v2ray-agent/v2ray/
echoContent skyBlue "\n进度 $1/${totalProgress} : 安装V2Ray"
if [[ -z `ls -F /etc/v2ray-agent/v2ray/|grep "v2ray"` ]] || [[ -z `ls -F /etc/v2ray-agent/v2ray/|grep "v2ctl"` ]] if [[ -z `ls -F /etc/v2ray-agent/v2ray/|grep "v2ray"` ]] || [[ -z `ls -F /etc/v2ray-agent/v2ray/|grep "v2ctl"` ]]
then then
progressTools "yellow" "检查、安装V2Ray--->" 20 # progressTools "yellow" "检查、安装V2Ray--->" 20
version=`curl -s https://github.com/v2fly/v2ray-core/releases|grep /v2ray-core/releases/tag/|head -1|awk -F "[/]" '{print $6}'|awk -F "[>]" '{print $2}'|awk -F "[<]" '{print $1}'` version=`curl -s https://github.com/v2fly/v2ray-core/releases|grep /v2ray-core/releases/tag/|head -1|awk -F "[/]" '{print $6}'|awk -F "[>]" '{print $2}'|awk -F "[<]" '{print $1}'`
progressTools "green" " v2ray-core版本:${version}" # progressTools "green" " v2ray-core版本:${version}"
echoContent green " ---> v2ray-core版本:${version}"
wget -q -P /etc/v2ray-agent/v2ray https://github.com/v2fly/v2ray-core/releases/download/${version}/v2ray-linux-64.zip wget -q -P /etc/v2ray-agent/v2ray https://github.com/v2fly/v2ray-core/releases/download/${version}/v2ray-linux-64.zip
unzip /etc/v2ray-agent/v2ray/v2ray-linux-64.zip -d /etc/v2ray-agent/v2ray > /dev/null unzip /etc/v2ray-agent/v2ray/v2ray-linux-64.zip -d /etc/v2ray-agent/v2ray > /dev/null
rm -rf /etc/v2ray-agent/v2ray/v2ray-linux-64.zip rm -rf /etc/v2ray-agent/v2ray/v2ray-linux-64.zip
else else
progressTools "green" " v2ray-core版本:`/etc/v2ray-agent/v2ray/v2ray --version|awk '{print $2}'|head -1`" # progressTools "green" " v2ray-core版本:`/etc/v2ray-agent/v2ray/v2ray --version|awk '{print $2}'|head -1`"
echoContent green " ---> v2ray-core版本:`/etc/v2ray-agent/v2ray/v2ray --version|awk '{print $2}'|head -1`"
fi fi
} }
# 验证整个服务是否可用 # 验证整个服务是否可用
checkGFWStatue(){ checkGFWStatue(){
# 验证整个服务是否可用 # 验证整个服务是否可用
progressTools "yellow" "验证服务是否可用--->" # progressTools "yellow" "验证服务是否可用--->"
echoContent skyBlue "\n进度 $1/${totalProgress} : 验证服务是否可用"
if [[ "${globalType}" = "wss" ]] if [[ "${globalType}" = "wss" ]]
then then
sleep 3 sleep 3
if [[ ! -z `curl -s -L https://${domain}/${customPath}|grep -v grep|grep "Bad Request"` ]] if [[ ! -z `curl -s -L https://${domain}/${customPath}|grep -v grep|grep "Bad Request"` ]]
then then
progressTools "green" " 服务可用--->" echoContent green " ---> 服务可用"
# progressTools "green" " 服务可用--->"
else else
progressTools "red" " 服务不可用请检查Cloudflare->域名->SSL/TLS->Overview->Your SSL/TLS encryption mode is 是否是Full--->" progressTools "red" " 服务不可用请检查Cloudflare->域名->SSL/TLS->Overview->Your SSL/TLS encryption mode is 是否是Full--->"
progressTools "red" " 错误日志:`curl -s -L https://${domain}/${customPath}`" progressTools "red" " 错误日志:`curl -s -L https://${domain}/${customPath}`"
@ -464,7 +517,8 @@ checkGFWStatue(){
sleep 0.1 sleep 0.1
if [[ ! -z `cat /etc/v2ray-agent/v2ray/v2ray_access_ws_tls.log|grep -v grep|grep "Not Found"` ]] if [[ ! -z `cat /etc/v2ray-agent/v2ray/v2ray_access_ws_tls.log|grep -v grep|grep "Not Found"` ]]
then then
progressTools "green" " 服务可用--->" # progressTools "green" " 服务可用--->"
echoContent green " ---> 服务可用"
else else
progressTools "red" " 服务不可用" progressTools "red" " 服务不可用"
progressTools "red" " 1.请检查云朵是否关闭" progressTools "red" " 1.请检查云朵是否关闭"
@ -473,11 +527,13 @@ checkGFWStatue(){
fi fi
elif [[ "${globalType}" = "vlesstcpws" ]] elif [[ "${globalType}" = "vlesstcpws" ]]
then then
progressTools "yellow" "等待三秒--->" # progressTools "yellow" "等待三秒--->"
echoContent green " ---> 等待三秒"
sleep 3 sleep 3
if [[ ! -z `curl -s -L https://${domain}/${customPath}|grep -v grep|grep "Bad Request"` ]] if [[ ! -z `curl -s -L https://${domain}/${customPath}|grep -v grep|grep "Bad Request"` ]]
then then
progressTools "green" " 服务可用--->" # progressTools "green" " 服务可用--->"
echoContent green " ---> 服务可用"
else else
progressTools "red" " 服务不可用请检查Cloudflare->域名->SSL/TLS->Overview->Your SSL/TLS encryption mode is 是否是Full--->" progressTools "red" " 服务不可用请检查Cloudflare->域名->SSL/TLS->Overview->Your SSL/TLS encryption mode is 是否是Full--->"
progressTools "red" " 错误日志:`curl -s -L https://${domain}/${customPath}`" progressTools "red" " 错误日志:`curl -s -L https://${domain}/${customPath}`"
@ -487,7 +543,8 @@ checkGFWStatue(){
} }
# 开机自启 # 开机自启
installV2RayService(){ installV2RayService(){
progressTools "yellow" " 配置V2Ray开机自启--->" echoContent skyBlue "\n进度 $1/${totalProgress} : 配置V2Ray开机自启"
# progressTools "yellow" " 配置V2Ray开机自启--->"
if [[ ! -z `find /bin /usr/bin -name "systemctl"` ]] if [[ ! -z `find /bin /usr/bin -name "systemctl"` ]]
then then
rm -rf /etc/systemd/system/v2ray.service rm -rf /etc/systemd/system/v2ray.service
@ -515,7 +572,8 @@ installV2RayService(){
EOF EOF
systemctl daemon-reload systemctl daemon-reload
systemctl enable v2ray.service systemctl enable v2ray.service
progressTools "green" " 配置V2Ray开机自启成功--->" # progressTools "green" " 配置V2Ray开机自启成功--->"
echoContent green " ---> 配置V2Ray开机自启成功"
fi fi
} }
# 操作V2Ray # 操作V2Ray
@ -543,20 +601,20 @@ handleV2Ray(){
then then
if [[ ! -z `ps -ef|grep -v grep|grep v2ray` ]] if [[ ! -z `ps -ef|grep -v grep|grep v2ray` ]]
then then
echoContent green "V2Ray启动成功" no echoContent green " ---> V2Ray启动成功"
else else
echoContent red "V2Ray启动失败" no echoContent red "V2Ray启动失败"
echoContent red "请手动执行【/usr/bin/v2ray/v2ray -config /etc/v2ray-agent/v2ray/config.json】,查看错误日志" no echoContent red "请手动执行【/usr/bin/v2ray/v2ray -config /etc/v2ray-agent/v2ray/config.json】,查看错误日志"
exit 0; exit 0;
fi fi
elif [[ "$1" = "stop" ]] elif [[ "$1" = "stop" ]]
then then
if [[ -z `ps -ef|grep -v grep|grep v2ray` ]] if [[ -z `ps -ef|grep -v grep|grep v2ray` ]]
then then
echoContent green "V2Ray关闭成功" no echoContent green " ---> V2Ray关闭成功"
else else
echoContent red "V2Ray关闭失败" no echoContent red "V2Ray关闭失败"
echoContent red "请手动执行【ps -ef|grep -v grep|grep v2ray|awk '{print \$2}'|xargs kill -9】" no echoContent red "请手动执行【ps -ef|grep -v grep|grep v2ray|awk '{print \$2}'|xargs kill -9】"
exit 0; exit 0;
fi fi
fi fi
@ -566,7 +624,7 @@ initV2RayConfig(){
uuidtcp=`/etc/v2ray-agent/v2ray/v2ctl uuid` uuidtcp=`/etc/v2ray-agent/v2ray/v2ctl uuid`
uuidws=`/etc/v2ray-agent/v2ray/v2ctl uuid` uuidws=`/etc/v2ray-agent/v2ray/v2ctl uuid`
echoContent skyBlue "\n进度 $2/${totalProgress} : 初始化V2Ray配置"
# 自定义IPLC端口 # 自定义IPLC端口
if [[ ! -z ${iplc} ]] if [[ ! -z ${iplc} ]]
then then
@ -925,13 +983,11 @@ EOF
} }
# 自定义CDN IP # 自定义CDN IP
customCDNIP(){ customCDNIP(){
echoContent yellow "是否使用DNS智能解析进行自定义CDN IP" echoContent skyBlue "\n进度 $1/${totalProgress} : 添加DNS智能解析"
echoContent yellow " 移动:104.19.41.56"
echoContent skyBlue "智能DNS根据运营商自动切换CDN IP详情请查看[https://github.com/mack-a/v2ray-agent/blob/master/optimize_V2Ray.md]" "no" echoContent yellow " 联通:104.16.160.136"
echoContent yellow " 移动:104.19.41.56" "no" echoContent yellow " 电信:104.16.160.136"
echoContent yellow " 联通:104.16.160.136" "no" read -p '是否使用?[y/n]:' dnsProxy
echoContent yellow " 电信:104.16.160.136"
read -n1 -p '[y]使用,[回车]不使用:' dnsProxy
if [[ "${dnsProxy}" = "y" ]] if [[ "${dnsProxy}" = "y" ]]
then then
add="domain08.qiu4.ml" add="domain08.qiu4.ml"
@ -939,6 +995,7 @@ customCDNIP(){
} }
# 生成账号base64链接 # 生成账号base64链接
buildAccounts(){ buildAccounts(){
echoContent skyBlue "\n进度 $1/${totalProgress} : 初始化账号"
user=`cat /etc/v2ray-agent/v2ray/config.json|jq .inbounds[0]` user=`cat /etc/v2ray-agent/v2ray/config.json|jq .inbounds[0]`
ps="${domain}" ps="${domain}"
id=`echo ${user}|jq .settings.clients[0].id` id=`echo ${user}|jq .settings.clients[0].id`
@ -950,9 +1007,8 @@ buildAccounts(){
then then
path=\"/${customPath}\" path=\"/${customPath}\"
fi fi
echoContent red path:${path} # echoContent yellow "客户端链接--->\n"
echoContent red customPath:${customPath} echoContent green " ---> 客户端链接"
echoContent yellow "客户端链接--->\n"
defaultBase64Code "${ps}" "${id}" "${host}" "${path}" "${add}" defaultBase64Code "${ps}" "${id}" "${host}" "${path}" "${add}"
# quanMultBase64Code "${ps}" "${id}" "${host}" "${path}" "${add}" # quanMultBase64Code "${ps}" "${id}" "${host}" "${path}" "${add}"
} }
@ -967,10 +1023,10 @@ defaultBase64Code(){
then then
qrCodeBase64Default=`echo -n '{"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","net":"tcp","add":"'${host}'","allowInsecure":0,"method":"none","peer":""}'|sed 's#/#\\\/#g'|base64` qrCodeBase64Default=`echo -n '{"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","net":"tcp","add":"'${host}'","allowInsecure":0,"method":"none","peer":""}'|sed 's#/#\\\/#g'|base64`
qrCodeBase64Default=`echo ${qrCodeBase64Default}|sed 's/ //g'` qrCodeBase64Default=`echo ${qrCodeBase64Default}|sed 's/ //g'`
echoContent red "通用json(tcp+tls)--->" "no" echoContent yellow " ---> 通用json(tcp+tls)"
echoContent green ' {"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","net":"tcp","add":"'${host}'","allowInsecure":0,"method":"none","peer":""}\n' echoContent green ' {"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","net":"tcp","add":"'${host}'","allowInsecure":0,"method":"none","peer":""}\n'
# 通用Vmess # 通用Vmess
echoContent red "通用vmess(tcp+tls)链接--->" "no" echoContent yellow " ---> 通用vmess(tcp+tls)链接"
echoContent green " vmess://${qrCodeBase64Default}\n" echoContent green " vmess://${qrCodeBase64Default}\n"
echo "通用vmess(tcp+tls)链接: " > /etc/v2ray-agent/v2ray/usersv2ray.conf echo "通用vmess(tcp+tls)链接: " > /etc/v2ray-agent/v2ray/usersv2ray.conf
echo " vmess://${qrCodeBase64Default}" >> /etc/v2ray-agent/v2ray/usersv2ray.conf echo " vmess://${qrCodeBase64Default}" >> /etc/v2ray-agent/v2ray/usersv2ray.conf
@ -978,9 +1034,9 @@ defaultBase64Code(){
then then
qrCodeBase64Default=`echo -n '{"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"ws","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'"}'|sed 's#/#\\\/#g'|base64` qrCodeBase64Default=`echo -n '{"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"ws","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'"}'|sed 's#/#\\\/#g'|base64`
qrCodeBase64Default=`echo ${qrCodeBase64Default}|sed 's/ //g'` qrCodeBase64Default=`echo ${qrCodeBase64Default}|sed 's/ //g'`
echoContent red "通用json(ws+tls)--->" "no" echoContent yellow " ---> 通用json(ws+tls)"
echoContent green ' {"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"ws","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'"}\n' echoContent green ' {"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"ws","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'"}\n'
echoContent red "通用vmess(ws+tls)链接--->" "no" echoContent yellow " ---> 通用vmess(ws+tls)链接"
echoContent green " vmess://${qrCodeBase64Default}\n" echoContent green " vmess://${qrCodeBase64Default}\n"
echo "通用vmess(ws+tls)链接: " > /etc/v2ray-agent/v2ray/usersv2ray.conf echo "通用vmess(ws+tls)链接: " > /etc/v2ray-agent/v2ray/usersv2ray.conf
echo " vmess://${qrCodeBase64Default}" >> /etc/v2ray-agent/v2ray/usersv2ray.conf echo " vmess://${qrCodeBase64Default}" >> /etc/v2ray-agent/v2ray/usersv2ray.conf
@ -988,21 +1044,20 @@ defaultBase64Code(){
then then
qrCodeBase64Default=`echo -n '{"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"h2","add":"'${add}'","allowInsecure":0,"method":"none","peer":""}'|sed 's#/#\\\/#g'|base64` qrCodeBase64Default=`echo -n '{"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"h2","add":"'${add}'","allowInsecure":0,"method":"none","peer":""}'|sed 's#/#\\\/#g'|base64`
qrCodeBase64Default=`echo ${qrCodeBase64Default}|sed 's/ //g'` qrCodeBase64Default=`echo ${qrCodeBase64Default}|sed 's/ //g'`
echoContent red "通用json--->" "no" echoContent red "通用json--->"
echoContent green ' {"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"h2","add":"'${add}'","allowInsecure":0,"method":"none","peer":""}\n' echoContent green ' {"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"h2","add":"'${add}'","allowInsecure":0,"method":"none","peer":""}\n'
elif [[ "${globalType}" = "vlesstcpws" ]] elif [[ "${globalType}" = "vlesstcpws" ]]
then then
echoContent red path:${path} "no"
qrCodeBase64Default=`echo -n '{"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"ws","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'"}'|sed 's#/#\\\/#g'|base64` qrCodeBase64Default=`echo -n '{"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"ws","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'"}'|sed 's#/#\\\/#g'|base64`
qrCodeBase64Default=`echo ${qrCodeBase64Default}|sed 's/ //g'` qrCodeBase64Default=`echo ${qrCodeBase64Default}|sed 's/ //g'`
echoContent red "通用json(ws+tls)--->" "no" echoContent yellow " ---> 通用json(ws+tls)"
echoContent green ' {"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"ws","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'"}\n' echoContent green ' {"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"ws","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'"}\n'
echoContent red "通用vmess(ws+tls)链接--->" "no" echoContent yellow " ---> 通用vmess(ws+tls)链接"
echoContent green " vmess://${qrCodeBase64Default}\n" echoContent green " vmess://${qrCodeBase64Default}\n"
echo "通用vmess(ws+tls)链接: " > /etc/v2ray-agent/v2ray/usersv2ray.conf echo "通用vmess(ws+tls)链接: " > /etc/v2ray-agent/v2ray/usersv2ray.conf
echo " vmess://${qrCodeBase64Default}" >> /etc/v2ray-agent/v2ray/usersv2ray.conf echo " vmess://${qrCodeBase64Default}" >> /etc/v2ray-agent/v2ray/usersv2ray.conf
echoContent red "通用json(VLESS+tcp+tls)--->" "no" echoContent yellow " ---> 通用json(VLESS+tcp+tls)"
echoContent green ' {"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"host":"'${host}'","type":"none","net":"tcp","add":"'${host}'","allowInsecure":0,"method":"none","peer":""}\n' echoContent green ' {"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"host":"'${host}'","type":"none","net":"tcp","add":"'${host}'","allowInsecure":0,"method":"none","peer":""}\n'
echoContent green ' V2Ray v4.27.4 目前无通用订阅需要手动配置VLESS和tcp大部分一样其余内容不变' echoContent green ' V2Ray v4.27.4 目前无通用订阅需要手动配置VLESS和tcp大部分一样其余内容不变'
fi fi
@ -1017,12 +1072,12 @@ quanMultBase64Code(){
local path=$4 local path=$4
qrCodeBase64Quanmult=`echo -n ''${ps}' = vmess, '${add}', 443, aes-128-cfb, '${id}', over-tls=true, tls-host='${host}', certificate=1, obfs=ws, obfs-path='${path}', obfs-header="Host: '${host}'[Rr][Nn]User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_6 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) Mobile/15D100"'|base64` qrCodeBase64Quanmult=`echo -n ''${ps}' = vmess, '${add}', 443, aes-128-cfb, '${id}', over-tls=true, tls-host='${host}', certificate=1, obfs=ws, obfs-path='${path}', obfs-header="Host: '${host}'[Rr][Nn]User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_6 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) Mobile/15D100"'|base64`
qrCodeBase64Quanmult=`echo ${qrCodeBase64Quanmult}|sed 's/ //g'` qrCodeBase64Quanmult=`echo ${qrCodeBase64Quanmult}|sed 's/ //g'`
echoContent red "Quantumult vmess--->" "no" echoContent red "Quantumult vmess--->"
echoContent green " vmess://${qrCodeBase64Quanmult}\n" echoContent green " vmess://${qrCodeBase64Quanmult}\n"
echo '' >> /etc/v2ray-agent/v2ray/usersv2ray.conf echo '' >> /etc/v2ray-agent/v2ray/usersv2ray.conf
echo "Quantumult:" >> /etc/v2ray-agent/v2ray/usersv2ray.conf echo "Quantumult:" >> /etc/v2ray-agent/v2ray/usersv2ray.conf
echo " vmess://${qrCodeBase64Quanmult}" >> /etc/v2ray-agent/v2ray/usersv2ray.conf echo " vmess://${qrCodeBase64Quanmult}" >> /etc/v2ray-agent/v2ray/usersv2ray.conf
echoContent red "Quantumult 明文--->" "no" echoContent red "Quantumult 明文--->"
echoContent green ' '${ps}' = vmess, '${add}', 443, aes-128-cfb, '${id}', over-tls=true, tls-host='${host}', certificate=1, obfs=ws, obfs-path='${path}', obfs-header="Host: '${host}'[Rr][Nn]User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_6 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) Mobile/15D100"' echoContent green ' '${ps}' = vmess, '${add}', 443, aes-128-cfb, '${id}', over-tls=true, tls-host='${host}', certificate=1, obfs=ws, obfs-path='${path}', obfs-header="Host: '${host}'[Rr][Nn]User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_6 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) Mobile/15D100"'
} }
# 查看本机ip # 查看本机ip
@ -1090,44 +1145,77 @@ installProgressFunction(){
done done
} }
# 卸载安装的内容 # 卸载脚本
removeInstall(){ unInstall(){
rm -rf /etc/v2ray-agent/v2ray echo
rm -rf /etc/v2ray-agent/tls handleNginx stop
rm -rf /etc/v2ray if [[ -z `ps -ef|grep -v grep|grep nginx` ]]
rm -rf /root/.acme.sh then
echo ${removeType},${installType} echoContent green "停止Nginx成功\n"
`${removeType} nginx` > /dev/null 2>&1 fi
handleV2Ray stop
rm -rf /etc/systemd/system/v2ray.service
echoContent red "删除V2Ray开机自启成功"
if [[ -d "/etc/v2ray-agent/tls" ]] && [[ ! -z `find /etc/v2ray-agent/tls/ -name "*.key"` ]] && [[ ! -z `find /etc/v2ray-agent/tls/ -name "*.crt"` ]]
then
mv /etc/v2ray-agent/tls /tmp
if [[ ! -z `find /tmp/tls -name '*.key'` ]]
then
echoContent green "备份证书成功,请注意留存。[/tmp/tls]"
fi
fi
rm -rf /etc/v2ray-agent
echoContent green "卸载完成"
} }
menu(){ menu(){
# 新建所需目录 # 新建所需目录
mkdirTools
cd cd
echoContent red "==============================================================" "no" echoContent red "\n=============================================================="
echoContent green "作者mack-a" no echoContent green "作者mack-a"
echoContent green "Versionv1.0.9" no echoContent green "Versionv1.0.9"
echoContent red "==============================================================" "no" echoContent red "=============================================================="
echoContent yellow "1.V2Ray+VLESS+TLS+TCP+Web/V2Ray+Vmess+TLS+WS+Web[CDN 云朵必须为灰色]" "no" echoContent yellow "1.V2Ray+VLESS+TLS+TCP+Web/V2Ray+Vmess+TLS+WS+Web[CDN 云朵必须为灰色]"
# echoContent yellow "2.V2Ray+TCP+TLS" "no" # echoContent yellow "2.V2Ray+TCP+TLS"
echoContent red "==============================================================" "no" echoContent red "=============================================================="
echoContent yellow "4.更新V2Ray[todo]" "no" echoContent yellow "4.更新V2Ray[todo]"
echoContent yellow "5.状态展示[todo]" "no" echoContent yellow "5.状态展示[todo]"
echoContent yellow "6.安装BBR[todo]" "no" echoContent yellow "6.安装BBR"
echoContent yellow "7.卸载脚本[todo]" "no" echoContent yellow "7.卸载脚本"
echoContent red "=============================================================="
echoContent red "==============================================================" "no" read -p "请选择:" selectInstallType
read -n1 -p "请选择:" selectInstallType
case ${selectInstallType} in case ${selectInstallType} in
1) 1)
installV2RayVLESSTCPWSTLS installV2RayVLESSTCPWSTLS
;; ;;
# 2) 6)
# installV2RayVmessTCPTLS bbrInstall
# ;; ;;
7)
unInstall
;;
esac esac
echoContent red "未实现" # echoContent red "未实现"
exit 0; exit 0;
} }
# 安装BBR
bbrInstall(){
echoContent red "\n=============================================================="
echoContent green "BBR脚本用的[ylx2016]的成熟作品,地址[https://github.com/ylx2016/Linux-NetSpeed/releases/download/sh/tcp.sh],请熟知"
echoContent red " 1.安装【推荐原版BBR+FQ】"
echoContent red " 2.回退主目录"
echoContent red "=============================================================="
read -p "请选择:" installBBRStatus
if [[ "${installBBRStatus}" = "1" ]]
then
wget -N --no-check-certificate "https://raw.githubusercontent.com/ylx2016/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh
else
menu
fi
}
# 安装V2Ray+wss+Nginx+Web # 安装V2Ray+wss+Nginx+Web
installV2RayVmessWSSNginxWeb(){ installV2RayVmessWSSNginxWeb(){
globalType=wss globalType=wss
@ -1168,44 +1256,45 @@ installV2RayVmessTCPTLS(){
progressTools "yellow" "安装完毕[100%]--->" progressTools "yellow" "安装完毕[100%]--->"
} }
installV2RayVLESSTCPWSTLS(){ installV2RayVLESSTCPWSTLS(){
mkdirTools totalProgress=14
globalType=vlesstcpws globalType=vlesstcpws
installTools mkdirTools 1
installTools 2
# 申请tls # 申请tls
initTLSNginxConfig initTLSNginxConfig 3
installTLS installTLS 4
handleNginx stop handleNginx stop
initNginxConfig vlesstcpws initNginxConfig vlesstcpws 5
randomPathFunction randomPathFunction 6
installCronTLS installCronTLS 7
# 安装V2Ray # 安装V2Ray
installV2Ray installV2Ray 8
installV2RayService installV2RayService 9
initV2RayConfig vlesstcpws initV2RayConfig vlesstcpws 10
nginxBlog nginxBlog 11
handleV2Ray start handleV2Ray start
handleNginx start handleNginx start
customCDNIP customCDNIP 12
# 生成账号 # 生成账号
checkGFWStatue checkGFWStatue 13
buildAccounts buildAccounts 14
progressTools "yellow" "安装完毕[100%]--->" # progressTools "yellow" "安装完毕[100%]--->"
} }
# 注意事项 # 注意事项
warningMessage(){ warningMessage(){
echoContent green "1.脚本会检查并安装工具包" echoContent green "1.脚本会检查并安装工具包"
echoContent green "2.如果使用此脚本生成过TLS证书、V2Ray会继续使用上次生成、安装的内容。" "no" echoContent green "2.如果使用此脚本生成过TLS证书、V2Ray会继续使用上次生成、安装的内容。"
echoContent green "3.会删除、卸载已经安装的应用包括V2Ray、Nginx。" "no" echoContent green "3.会删除、卸载已经安装的应用包括V2Ray、Nginx。"
echoContent green "4.如果显示Nginx不可用请检查防火墙端口是否开放。" "no" echoContent green "4.如果显示Nginx不可用请检查防火墙端口是否开放。"
echoContent green "5.证书会在每天的1点30分检查更新" "no" echoContent green "5.证书会在每天的1点30分检查更新"
echoContent red "==============================================================" "no" echoContent red "=============================================================="
} }
# 错误信息处理 # 错误信息处理
errorMessage(){ errorMessage(){
echoContent yellow "Debian" "no" echoContent yellow "Debian"
echoContent green " 错误1WARNING: apt does not have a stable CLI interface. Use with caution in scripts.【这个错误无需处理】" "no" echoContent green " 错误1WARNING: apt does not have a stable CLI interface. Use with caution in scripts.【这个错误无需处理】"
echoContent green " 错误2如果错误很多且安装失败则需要重启vps无需重新安装OS。这种情况是在安装过程中意外断开导致。" "no" echoContent green " 错误2如果错误很多且安装失败则需要重启vps无需重新安装OS。这种情况是在安装过程中意外断开导致。"
echoContent red "==============================================================" "no" echoContent red "=============================================================="
} }
# 状态展示 # 状态展示
state(){ state(){