mirror of https://github.com/mack-a/v2ray-agent
feat(脚本): 修改finalshell意外退出问题、删除冗余代码
parent
690b72e06d
commit
f8811e0d48
27
install.sh
27
install.sh
|
@ -17,12 +17,12 @@ uuidVlessWS=
|
||||||
uuidtcpdirect=
|
uuidtcpdirect=
|
||||||
customInstallType=
|
customInstallType=
|
||||||
|
|
||||||
trap 'onCtrlC' INT
|
# trap 'onCtrlC' INT
|
||||||
function onCtrlC () {
|
# function onCtrlC () {
|
||||||
echo
|
# echo
|
||||||
killSleep > /dev/null 2>&1
|
# killSleep > /dev/null 2>&1
|
||||||
exit;
|
# exit;
|
||||||
}
|
# }
|
||||||
# echo颜色方法
|
# echo颜色方法
|
||||||
echoContent(){
|
echoContent(){
|
||||||
case $1 in
|
case $1 in
|
||||||
|
@ -206,7 +206,6 @@ installTools(){
|
||||||
echoContent red " 1.获取Github文件失败,请等待GitHub恢复后尝试,恢复进度可查看 [https://www.githubstatus.com/]"
|
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 " 2.acme.sh脚本出现bug,可查看[https://github.com/acmesh-official/acme.sh] issues"
|
||||||
echoContent red " 3.反馈给开发者[私聊:https://t.me/mack_a] 或 [提issues]"
|
echoContent red " 3.反馈给开发者[私聊:https://t.me/mack_a] 或 [提issues]"
|
||||||
killSleep > /dev/null 2>&1
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -221,7 +220,6 @@ installTools(){
|
||||||
echoContent red " 1.获取Github文件失败,请等待GitHub恢复后尝试,恢复进度可查看 [https://www.githubstatus.com/]"
|
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 " 2.acme.sh脚本出现bug,可查看[https://github.com/acmesh-official/acme.sh] issues"
|
||||||
echoContent red " 3.反馈给开发者[私聊:https://t.me/mack_a] 或 [提issues]"
|
echoContent red " 3.反馈给开发者[私聊:https://t.me/mack_a] 或 [提issues]"
|
||||||
killSleep > /dev/null 2>&1
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -229,8 +227,6 @@ installTools(){
|
||||||
# 初始化Nginx申请证书配置
|
# 初始化Nginx申请证书配置
|
||||||
initTLSNginxConfig(){
|
initTLSNginxConfig(){
|
||||||
handleNginx stop
|
handleNginx stop
|
||||||
killSleep > /dev/null 2>&1
|
|
||||||
killSleep > /dev/null 2>&1
|
|
||||||
echoContent skyBlue "\n进度 $1/${totalProgress} : 初始化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
|
||||||
|
@ -254,7 +250,6 @@ initTLSNginxConfig(){
|
||||||
echoContent green " ---> Nginx配置成功"
|
echoContent green " ---> Nginx配置成功"
|
||||||
else
|
else
|
||||||
echoContent red " 无法正常访问服务器,请检测域名是否正确、域名的DNS解析以及防火墙设置是否正确--->"
|
echoContent red " 无法正常访问服务器,请检测域名是否正确、域名的DNS解析以及防火墙设置是否正确--->"
|
||||||
killSleep > /dev/null 2>&1
|
|
||||||
exit 0;
|
exit 0;
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -1536,7 +1531,6 @@ progressTools(){
|
||||||
installProgress=$3
|
installProgress=$3
|
||||||
# echo ${color},${content},${installProgress}
|
# echo ${color},${content},${installProgress}
|
||||||
echoContent ${color} "${content}"
|
echoContent ${color} "${content}"
|
||||||
killSleep > /dev/null 2>&1
|
|
||||||
if [[ ! -z "${installProgress}" ]]
|
if [[ ! -z "${installProgress}" ]]
|
||||||
then
|
then
|
||||||
installProgressFunction ${installProgress} ${totalProgress} &
|
installProgressFunction ${installProgress} ${totalProgress} &
|
||||||
|
@ -1722,7 +1716,7 @@ unInstall(){
|
||||||
if [[ -d "/etc/v2ray-agent/tls" ]] && [[ ! -z `find /etc/v2ray-agent/tls/ -name "*.key"` ]] && [[ ! -z `find /etc/v2ray-agent/tls/ -name "*.crt"` ]]
|
if [[ -d "/etc/v2ray-agent/tls" ]] && [[ ! -z `find /etc/v2ray-agent/tls/ -name "*.key"` ]] && [[ ! -z `find /etc/v2ray-agent/tls/ -name "*.crt"` ]]
|
||||||
then
|
then
|
||||||
mv /etc/v2ray-agent/tls /tmp/v2ray-agent-tls
|
mv /etc/v2ray-agent/tls /tmp/v2ray-agent-tls
|
||||||
if [[ ! -z `find /tmp/tls -name '*.key'` ]]
|
if [[ ! -z `find /tmp/v2ray-agent-tls -name '*.key'` ]]
|
||||||
then
|
then
|
||||||
echoContent yellow " ---> 备份证书成功,请注意留存。[/tmp/v2ray-agent-tls]"
|
echoContent yellow " ---> 备份证书成功,请注意留存。[/tmp/v2ray-agent-tls]"
|
||||||
fi
|
fi
|
||||||
|
@ -1936,9 +1930,7 @@ customInstall(){
|
||||||
then
|
then
|
||||||
echoContent red " ---> 不可为空"
|
echoContent red " ---> 不可为空"
|
||||||
customInstall
|
customInstall
|
||||||
exit 0;
|
elif [[ "${customInstallType}" =~ ^[0-4]+$ ]]
|
||||||
fi
|
|
||||||
if [[ "${customInstallType}" =~ ^[0-4]+$ ]]
|
|
||||||
then
|
then
|
||||||
totalProgress=17
|
totalProgress=17
|
||||||
globalType=vlesstcpws
|
globalType=vlesstcpws
|
||||||
|
@ -1983,6 +1975,7 @@ customInstall(){
|
||||||
showAccounts 17
|
showAccounts 17
|
||||||
else
|
else
|
||||||
echoContent red " ---> 输入不合法"
|
echoContent red " ---> 输入不合法"
|
||||||
|
customInstall
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
# 初始化个性化安装类型
|
# 初始化个性化安装类型
|
||||||
|
@ -2084,7 +2077,6 @@ menu(){
|
||||||
unInstall 1
|
unInstall 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
exit 0;
|
|
||||||
}
|
}
|
||||||
# 安装BBR
|
# 安装BBR
|
||||||
bbrInstall(){
|
bbrInstall(){
|
||||||
|
@ -2244,7 +2236,6 @@ checkSystem(){
|
||||||
echoContent red "本脚本不支持此系统,请将下方日志反馈给开发者"
|
echoContent red "本脚本不支持此系统,请将下方日志反馈给开发者"
|
||||||
cat /etc/issue
|
cat /etc/issue
|
||||||
cat /proc/version
|
cat /proc/version
|
||||||
killSleep > /dev/null 2>&1
|
|
||||||
exit 0;
|
exit 0;
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue