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
fi
echo "What type of VPN or proxy will be used?"
echo "1) VLESS, Shadowsocks (A sing-box will be installed)"
echo "2) Wireguard"
echo "3) AmneziaWG"
echo "4) OpenVPN"
echo "5) OpenConnect"
echo "6) Skip this step"
add_tunnel() {
echo "What type of VPN or proxy will be used?"
echo "1) VLESS, Shadowsocks (A sing-box will be installed)"
echo "2) Wireguard"
echo "3) AmneziaWG"
echo "4) OpenVPN"
echo "5) OpenConnect"
echo "6) Skip this step"
while true; do
while true; do
read -r -p '' TUNNEL
case $TUNNEL in
@@ -92,7 +93,10 @@ while true; do
echo "Choose from the following options"
;;
esac
done
done
}
add_tunnel
echo "Installed podkop..."
opkg install $DOWNLOAD_DIR/podkop*.ipk