From 7f412adde76cb2cfe16eb5ac5ede00e51e8c2acf Mon Sep 17 00:00:00 2001 From: lsy Date: Sun, 22 Sep 2024 21:37:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=8D=A2vpn=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E5=92=8C=E6=BA=90=E6=A3=80=E6=B5=8B=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Menus/Sources.sh | 2 +- Menus/Vpn.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Menus/Sources.sh b/Menus/Sources.sh index cc650bf..9c08436 100644 --- a/Menus/Sources.sh +++ b/Menus/Sources.sh @@ -23,7 +23,7 @@ read -p "请输入:" pick if [[ -z $pick ]];then declare url='http://mirrors.ustc.edu.cn' -elif [[ ${pick} -le 0 || ${pick} -gt ${#sources_dick[*]} ]];then +elif [[ ${pick} =~ [1-${#sources_dick[@]}] ]];then echo "输入错误" exit else diff --git a/Menus/Vpn.sh b/Menus/Vpn.sh index 37c095f..bf4d226 100644 --- a/Menus/Vpn.sh +++ b/Menus/Vpn.sh @@ -16,7 +16,7 @@ for i in "${!vpn_array[@]}";do done read -p "请输入要选择的序号:" vpn_pick -if [[ $vpn_pick =~ [1-$vpn_number] ]];then +if [[ $vpn_pick =~ [1-${#vpn_array[@]}] ]];then eval "${vpn_array[${vpn_index[$vpn_pick]}]}" echo "安装完成" else