This commit is contained in:
2023-12-21 20:56:43 +05:00
parent 32b93da2c3
commit 2dd17afcb3

View File

@@ -42,10 +42,9 @@ add_tunnel() {
echo "We can automatically configure only Wireguard. OpenVPN, Sing-box(Shadowsocks2022, VMess, VLESS, etc) and tun2socks will need to be configured manually"
echo "Select a tunnel:"
echo "1) WireGuard"
echo "2) OpenVPN"
echo "3) Sing-box"
echo "4) tun2socks"
echo "5) Skip this step"
echo "2) Sing-box"
echo "3) tun2socks"
echo "4) Skip this step"
while true; do
read -r -p '' TUNNEL
@@ -56,22 +55,17 @@ add_tunnel() {
break
;;
2)
TUNNEL=ovpn
break
;;
3)
2)
TUNNEL=singbox
break
;;
4)
3)
TUNNEL=tun2socks
break
;;
5)
4)
echo "Skip"
TUNNEL=0
break
@@ -136,17 +130,6 @@ add_tunnel() {
uci commit
fi
if [ "$TUNNEL" == 'ovpn' ]; then
if opkg list-installed | grep -q openvpn-openssl; then
echo "OpenVPN already installed"
else
echo "Installed openvpn"
opkg install openvpn-openssl
fi
printf "\033[32;1mConfigure route for OpenVPN\033[0m\n"
route_vpn
fi
if [ "$TUNNEL" == 'singbox' ]; then
if opkg list-installed | grep -q sing-box; then
echo "Sing-box already installed"
@@ -288,11 +271,6 @@ add_zone() {
remove_forwarding
fi
if [[ $TUNNEL != "ovpn" ]]; then
forward_id=$(uci show firewall | grep -E "@forwarding.*dest='ovpn'" | awk -F '[][{}]' '{print $2}' | head -n 1)
remove_forwarding
fi
if [[ $TUNNEL != "singbox" ]]; then
forward_id=$(uci show firewall | grep -E "@forwarding.*dest='singbox'" | awk -F '[][{}]' '{print $2}' | head -n 1)
remove_forwarding
@@ -317,9 +295,6 @@ show_manual() {
if [ "$TUNNEL" == tun2socks ]; then
printf "\033[42;1mZone for tun2socks cofigured. But you need to set up the tunnel yourself.\033[0m\n"
echo "Use this manual: https://cli.co/VNZISEM"
elif [ "$TUNNEL" == ovpn ]; then
printf "\033[42;1mZone for OpenVPN cofigured. But you need to set up the tunnel yourself.\033[0m\n"
echo "Use this manual: https://itdog.info/nastrojka-klienta-openvpn-na-openwrt/"
fi
}