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或域名?"