mirror of https://github.com/mack-a/v2ray-agent
feat(脚本): 修改安装工具时的搜索条件、修改安装acme时的判断
parent
e5298806c5
commit
a02fc06f81
29
install.sh
29
install.sh
|
@ -336,34 +336,34 @@ installTools() {
|
|||
if [[ "${release}" == "centos" ]]; then
|
||||
rm -rf /var/run/yum.pid
|
||||
fi
|
||||
# [[ -z `find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin |grep -v grep|grep -w curl` ]]
|
||||
# [[ -z `find /usr/bin /usr/sbin |grep -v grep|grep -w curl` ]]
|
||||
|
||||
if ! find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin | grep -q -w wget; then
|
||||
if ! find /usr/bin /usr/sbin | grep -q -w wget; then
|
||||
echoContent green " ---> 安装wget"
|
||||
${installType} wget >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if ! find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin | grep -q -w curl; then
|
||||
if ! find /usr/bin /usr/sbin | grep -q -w curl; then
|
||||
echoContent green " ---> 安装curl"
|
||||
${installType} curl >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if ! find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin | grep -q -w unzip; then
|
||||
if ! find /usr/bin /usr/sbin | grep -q -w unzip; then
|
||||
echoContent green " ---> 安装unzip"
|
||||
${installType} unzip >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if ! find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin | grep -q -w socat; then
|
||||
if ! find /usr/bin /usr/sbin | grep -q -w socat; then
|
||||
echoContent green " ---> 安装socat"
|
||||
${installType} socat >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if ! find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin | grep -q -w tar; then
|
||||
if ! find /usr/bin /usr/sbin | grep -q -w tar; then
|
||||
echoContent green " ---> 安装tar"
|
||||
${installType} tar >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if ! find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin | grep -q -w cron; then
|
||||
if ! find /usr/bin /usr/sbin | grep -q -w cron; then
|
||||
echoContent green " ---> 安装crontabs"
|
||||
if [[ "${release}" == "ubuntu" ]] || [[ "${release}" == "debian" ]]; then
|
||||
${installType} cron >/dev/null 2>&1
|
||||
|
@ -371,22 +371,22 @@ installTools() {
|
|||
${installType} crontabs >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
if ! find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin | grep -q -w jq; then
|
||||
if ! find /usr/bin /usr/sbin | grep -q -w jq; then
|
||||
echoContent green " ---> 安装jq"
|
||||
${installType} jq >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if ! find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin | grep -q -w binutils; then
|
||||
if ! find /usr/bin /usr/sbin | grep -q -w binutils; then
|
||||
echoContent green " ---> 安装binutils"
|
||||
${installType} binutils >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if ! find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin | grep -q -w ping6; then
|
||||
if ! find /usr/bin /usr/sbin | grep -q -w ping6; then
|
||||
echoContent green " ---> 安装ping6"
|
||||
${installType} inetutils-ping >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if ! find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin | grep -q -w nginx; then
|
||||
if ! find /usr/bin /usr/sbin | grep -q -w nginx; then
|
||||
echoContent green " ---> 安装nginx"
|
||||
if [[ "${centosVersion}" == "8" ]]; then
|
||||
rpm -ivh ${nginxEpel} >/etc/v2ray-agent/error.log 2>&1
|
||||
|
@ -400,7 +400,7 @@ installTools() {
|
|||
fi
|
||||
fi
|
||||
|
||||
if ! find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin | grep -q -w semanage; then
|
||||
if ! find /usr/bin /usr/sbin | grep -q -w semanage; then
|
||||
echoContent green " ---> 安装semanage"
|
||||
${installType} bash-completion >/dev/null 2>&1
|
||||
if [[ -n "${policyCoreUtils}" ]]; then
|
||||
|
@ -412,13 +412,13 @@ installTools() {
|
|||
fi
|
||||
fi
|
||||
|
||||
if ! find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin | grep -q -w sudo; then
|
||||
if ! find /usr/bin /usr/sbin | grep -q -w sudo; then
|
||||
echoContent green " ---> 安装sudo"
|
||||
${installType} sudo >/dev/null 2>&1
|
||||
fi
|
||||
# todo 关闭防火墙
|
||||
|
||||
if [[ ! -d "$HOME/.acme.sh" ]]; then
|
||||
if [[ ! -d "$HOME/.acme.sh" ]] || [[ -d "$HOME/.acme.sh" && -z $(find "$HOME/.acme.sh/acme.sh") ]]; then
|
||||
echoContent green " ---> 安装acme.sh"
|
||||
curl -s https://get.acme.sh | sh >/etc/v2ray-agent/tls/acme.log
|
||||
if [[ -d "$HOME/.acme.sh" ]] && [[ -z $(find "$HOME/.acme.sh/acme.sh") ]]; then
|
||||
|
@ -426,7 +426,6 @@ installTools() {
|
|||
echoContent yellow "错误排查:"
|
||||
echoContent red " 1.获取Github文件失败,请等待Gitub恢复后尝试,恢复进度可查看 [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]"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue