refactor: move add tunnel to function

This commit is contained in:
Slava-Shchipunov
2024-11-03 22:13:16 +07:00
parent ee6bbe3f13
commit fe245c31c3

View File

@@ -25,15 +25,16 @@ else
[ -f /etc/config/dhcp-opkg ] && cp /etc/config/dhcp /etc/config/dhcp-old && mv /etc/config/dhcp-opkg /etc/config/dhcp [ -f /etc/config/dhcp-opkg ] && cp /etc/config/dhcp /etc/config/dhcp-old && mv /etc/config/dhcp-opkg /etc/config/dhcp
fi fi
echo "What type of VPN or proxy will be used?" add_tunnel() {
echo "1) VLESS, Shadowsocks (A sing-box will be installed)" echo "What type of VPN or proxy will be used?"
echo "2) Wireguard" echo "1) VLESS, Shadowsocks (A sing-box will be installed)"
echo "3) AmneziaWG" echo "2) Wireguard"
echo "4) OpenVPN" echo "3) AmneziaWG"
echo "5) OpenConnect" echo "4) OpenVPN"
echo "6) Skip this step" echo "5) OpenConnect"
echo "6) Skip this step"
while true; do while true; do
read -r -p '' TUNNEL read -r -p '' TUNNEL
case $TUNNEL in case $TUNNEL in
@@ -92,7 +93,10 @@ while true; do
echo "Choose from the following options" echo "Choose from the following options"
;; ;;
esac esac
done done
}
add_tunnel
echo "Installed podkop..." echo "Installed podkop..."
opkg install $DOWNLOAD_DIR/podkop*.ipk opkg install $DOWNLOAD_DIR/podkop*.ipk