更换vpn菜单和源检测方法

This commit is contained in:
lsy 2024-09-22 21:37:45 +08:00
parent 5befa76b71
commit 7f412adde7
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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