linuxtool/Menus/Vpn.sh

26 lines
900 B
Bash
Raw Normal View History

2024-09-20 14:43:38 +08:00
#!/bin/bash
2024-09-22 20:55:29 +08:00
declare vpn_number=0
2024-09-20 14:43:38 +08:00
declare -a vpn_index
declare -A vpn_array
2024-09-22 21:07:50 +08:00
declare vpn_pick
2024-09-20 14:43:38 +08:00
vpn_array["v2ray"]='bash <(curl -s -L https://git.io/v2ray.sh)'
vpn_array["v2ray-agent"]='wget -P /root -N --no-check-certificate "https://raw.githubusercontent.com/mack-a/v2ray-agent/master/install.sh" && chmod 700 /root/install.sh && /root/install.sh'
vpn_array["x-ui"]='bash <(curl -Ls https://raw.githubusercontent.com/FranzKafkaYu/x-ui/master/install.sh)'
vpn_array["V2bX"]='wget -N https://raw.githubusercontent.com/wyx2685/V2bX-script/master/install.sh && bash install.sh'
2024-09-20 14:43:38 +08:00
for i in "${!vpn_array[@]}";do
2024-09-22 20:55:29 +08:00
vpn_number=$((vpn_number+1))
2024-09-20 14:43:38 +08:00
vpn_index[${vpn_number}]=${i}
echo "${vpn_number}.${i}"
done
read -p "请输入要选择的序号:" vpn_pick
2024-09-20 14:49:39 +08:00
2024-09-22 21:37:45 +08:00
if [[ $vpn_pick =~ [1-${#vpn_array[@]}] ]];then
2024-09-20 14:58:32 +08:00
eval "${vpn_array[${vpn_index[$vpn_pick]}]}"
2024-09-20 14:55:13 +08:00
echo "安装完成"
2024-09-22 20:55:29 +08:00
else
echo "输入错误"
2024-09-20 14:49:39 +08:00
fi