From 81ee2119612d98a15dfffb45834cd41de715b9c0 Mon Sep 17 00:00:00 2001 From: KANIKIG Date: Sat, 23 Jan 2021 16:09:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=84=9A=E6=9C=AC=E8=87=AA=E5=8A=A8=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gost.sh | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/gost.sh b/gost.sh index 041fe09..35f57c9 100755 --- a/gost.sh +++ b/gost.sh @@ -2,6 +2,7 @@ Green_font_prefix="\033[32m" && Red_font_prefix="\033[31m" && Green_background_prefix="\033[42;37m" && Font_color_suffix="\033[0m" Info="${Green_font_prefix}[信息]${Font_color_suffix}" Error="${Red_font_prefix}[错误]${Font_color_suffix}" +shell_version="1.0.0" gost_conf_path="/etc/gost/config.json" raw_conf_path="/etc/gost/rawconf" function checknew() { @@ -617,7 +618,29 @@ function show_all_conf() { echo -e "--------------------------------------------------------" done } -echo && echo -e " gost 一键安装配置脚本 + +update_sh() { + ol_version=$(curl -L -s https://raw.githubusercontent.com/KANIKIG/Multi-EasyGost/master/gost.sh | grep "shell_version=" | head -1 | awk -F '=|"' '{print $3}') + if [[ "$shell_version" != "$ol_version" ]]; then + echo -e "存在新版本,是否更新 [Y/N]?" + read -r update_confirm + case $update_confirm in + [yY][eE][sS] | [yY]) + wget -N --no-check-certificate https://raw.githubusercontent.com/KANIKIG/Multi-EasyGost/master/gost.sh + echo -e "更新完成" + exit 0 + ;; + *) ;; + + esac + else + echo -e "当前版本为最新版本!" + fi + +} + + +echo && echo -e " gost 一键安装配置脚本"${Red_font_prefix}[${shell_version}]${Font_color_suffix}" ----------- KANIKIG ----------- 特性: (1)本脚本采用systemd及gost配置文件对gost进行管理 (2)能够在不借助其他工具(如screen)的情况下实现多条转发规则同时生效