From 06ca34152ab829393eb70268b2f0c880339f42c6 Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Wed, 3 Feb 2021 11:43:48 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=84=9A=E6=9C=AC):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E9=80=BB=E8=BE=91=E3=80=81?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9B=B4=E6=96=B0=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index c846ebd..bbf54e8 100644 --- a/install.sh +++ b/install.sh @@ -710,8 +710,10 @@ installCronTLS() { fi if [[ -n $(crontab -l | grep -v grep | grep '/etc/v2ray-agent/install.sh') ]]; then - local cronResult=$(cat /etc/v2ray-agent/backup_crontab.cron|uniq) - echo "${cronResult}" > /etc/v2ray-agent/backup_crontab.cron + + crontab -l | uniq | awk '/./ {print}' >>/etc/v2ray-agent/backup_crontab.cron + local crontabResult=$(cat /etc/v2ray-agent/backup_crontab.cron | uniq | awk '/./ {print}') + echo "${crontabResult}" >/etc/v2ray-agent/backup_crontab.cron crontab /etc/v2ray-agent/backup_crontab.cron echoContent green " ---> 添加定时维护证书成功" else @@ -2557,8 +2559,19 @@ removeUser() { # 更新脚本 updateV2RayAgent() { echoContent skyBlue "\n进度 $1/${totalProgress} : 更新v2ray-agent脚本" - wget -P /etc/v2ray-agent/ -N --no-check-certificate "https://raw.githubusercontent.com/mack-a/v2ray-agent/master/install.sh" && chmod 700 /etc/v2ray-agent/install.sh - echoContent skyBlue " ---> 更新完毕,请手动执行[vasma]打开脚本\n" + if wget --help | grep -q show-progress; then + wget -c -q --show-progress -P /etc/v2ray-agent/ -N --no-check-certificate "https://raw.githubusercontent.com/mack-a/v2ray-agent/master/install.sh" + else + wget -c -q -P /etc/v2ray-agent/ -N --no-check-certificate "https://raw.githubusercontent.com/mack-a/v2ray-agent/master/install.sh" + fi + + sudo chmod 700 /etc/v2ray-agent/install.sh + local version=$(cat /etc/v2ray-agent/install.sh | grep '当前版本:v' | awk -F "[v]" '{print $2}' | tail -n +2 | head -n 1 | awk -F "[\"]" '{print $1}') + + echoContent green "\n ---> 更新完毕" + echoContent yellow " ---> 请手动执行[vasma]打开脚本" + echoContent green " ---> 当前版本:${version}\n" + exit 0 } # 安装BBR @@ -3100,7 +3113,7 @@ menu() { cd "$HOME" || exit echoContent red "\n==============================================================" echoContent green "作者:mack-a" - echoContent green "当前版本:v2.3.14" + echoContent green "当前版本:v2.3.15" echoContent green "Github:https://github.com/mack-a/v2ray-agent" echoContent green "描述:七合一共存脚本" echoContent red "=============================================================="