fix
This commit is contained in:
@@ -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 "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 "Select a tunnel:"
|
||||||
echo "1) WireGuard"
|
echo "1) WireGuard"
|
||||||
echo "2) OpenVPN"
|
echo "2) Sing-box"
|
||||||
echo "3) Sing-box"
|
echo "3) tun2socks"
|
||||||
echo "4) tun2socks"
|
echo "4) Skip this step"
|
||||||
echo "5) Skip this step"
|
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
read -r -p '' TUNNEL
|
read -r -p '' TUNNEL
|
||||||
@@ -56,22 +55,17 @@ add_tunnel() {
|
|||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
|
|
||||||
2)
|
2)
|
||||||
TUNNEL=ovpn
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
|
|
||||||
3)
|
|
||||||
TUNNEL=singbox
|
TUNNEL=singbox
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
|
|
||||||
4)
|
3)
|
||||||
TUNNEL=tun2socks
|
TUNNEL=tun2socks
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
|
|
||||||
5)
|
4)
|
||||||
echo "Skip"
|
echo "Skip"
|
||||||
TUNNEL=0
|
TUNNEL=0
|
||||||
break
|
break
|
||||||
@@ -136,17 +130,6 @@ add_tunnel() {
|
|||||||
uci commit
|
uci commit
|
||||||
fi
|
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 [ "$TUNNEL" == 'singbox' ]; then
|
||||||
if opkg list-installed | grep -q sing-box; then
|
if opkg list-installed | grep -q sing-box; then
|
||||||
echo "Sing-box already installed"
|
echo "Sing-box already installed"
|
||||||
@@ -288,11 +271,6 @@ add_zone() {
|
|||||||
remove_forwarding
|
remove_forwarding
|
||||||
fi
|
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
|
if [[ $TUNNEL != "singbox" ]]; then
|
||||||
forward_id=$(uci show firewall | grep -E "@forwarding.*dest='singbox'" | awk -F '[][{}]' '{print $2}' | head -n 1)
|
forward_id=$(uci show firewall | grep -E "@forwarding.*dest='singbox'" | awk -F '[][{}]' '{print $2}' | head -n 1)
|
||||||
remove_forwarding
|
remove_forwarding
|
||||||
@@ -317,9 +295,6 @@ show_manual() {
|
|||||||
if [ "$TUNNEL" == tun2socks ]; then
|
if [ "$TUNNEL" == tun2socks ]; then
|
||||||
printf "\033[42;1mZone for tun2socks cofigured. But you need to set up the tunnel yourself.\033[0m\n"
|
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"
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user