From 2dc0a6a6fd55f09512e698cd338663c09d61f3e5 Mon Sep 17 00:00:00 2001 From: KANIKIG Date: Wed, 10 Mar 2021 23:42:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AC=E5=8F=91CDN=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=87=AA=E5=AE=9A=E4=B9=89=E7=AB=AF=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gost.sh | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/gost.sh b/gost.sh index 6a75e71..8035662 100755 --- a/gost.sh +++ b/gost.sh @@ -266,26 +266,22 @@ function read_d_ip() { echo -e "------------------------------------------------------------------" echo -e "将本机从${flag_b}接收到的流量转发向的自选ip:" read -p "请输入: " flag_c - if [ "$flag_a" == "cdnno" ]; then - echo -e "请问你要将本机从${flag_b}接收到的流量转发向${flag_c}的哪个端口?" - echo -e "[1] 80" - echo -e "[2] 443" - read -p "请选择端口: " cdnport - if [ "$cdnport" == "1" ]; then - flag_c="$flag_c:80" - elif [ "$cdnport" == "2" ]; then - flag_c="$flag_c:443" - else - echo "type error, please try again" - exit - fi - elif [ "$flag_a" == "cdnws" ]; then - echo -e "ws将默认转发至80端口" - flag_c="$flag_c:80" - else - echo -e "wss将默认转发至443端口" - flag_c="$flag_c:443" - fi + echo -e "请问你要将本机从${flag_b}接收到的流量转发向${flag_c}的哪个端口?" + echo -e "[1] 80" + echo -e "[2] 443" + echo -e "[3] 自定义端口(如8080等)" + read -p "请选择端口: " cdnport + if [ "$cdnport" == "1" ]; then + flag_c="$flag_c:80" + elif [ "$cdnport" == "2" ]; then + flag_c="$flag_c:443" + elif [ "$cdnport" == "3" ]; then + read -p "请输入自定义端口: " customport + flag_c="$flag_c:$customport" + else + echo "type error, please try again" + exit + fi else echo -e "------------------------------------------------------------------" echo -e "请问你要将本机从${flag_b}接收到的流量转发向哪个IP或域名?"