feat(脚本): 修改安装工具时的搜索条件、修改安装acme时的判断

pull/534/merge
mack-a 2021-01-18 11:00:50 +08:00
parent e5298806c5
commit a02fc06f81
1 changed files with 14 additions and 15 deletions

View File

@ -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