From 708d58ed462064c06a2a9a79c2963bdcd6b2c537 Mon Sep 17 00:00:00 2001 From: lsy Date: Sun, 22 Sep 2024 20:55:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9vpn=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Menus/Vpn.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Menus/Vpn.sh b/Menus/Vpn.sh index 9f305c7..4e41cb9 100644 --- a/Menus/Vpn.sh +++ b/Menus/Vpn.sh @@ -1,5 +1,5 @@ #!/bin/bash -declare vpn_number=1 +declare vpn_number=0 declare -a vpn_index declare -A vpn_array declarec vpn_pick @@ -10,16 +10,16 @@ vpn_array["x-ui"]='bash <(curl -Ls https://raw.githubusercontent.com/FranzKafkaY vpn_array["V2bX"]='wget -N https://raw.githubusercontent.com/wyx2685/V2bX-script/master/install.sh && bash install.sh' for i in "${!vpn_array[@]}";do + vpn_number=$((vpn_number+1)) vpn_index[${vpn_number}]=${i} echo "${vpn_number}.${i}" - vpn_number=$((vpn_number+1)) done read -p "请输入要选择的序号:" vpn_pick -if [[ -z ${vpn_array[${vpn_index[$vpn_pick]}]} ]];then - echo "输入错误" -else +if [[ $vpn_pick -gt 0 && $vpn_pick -lt $vpn_number ]];then eval "${vpn_array[${vpn_index[$vpn_pick]}]}" echo "安装完成" +else + echo "输入错误" fi