From a7a54566fd101e53b5bc1c2f05a7bcb09535beb4 Mon Sep 17 00:00:00 2001 From: jahlib <60108339+jahlib@users.noreply.github.com> Date: Thu, 7 May 2026 11:13:07 +0300 Subject: [PATCH] bug fixes --- quick-install.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/quick-install.sh b/quick-install.sh index 63c1b6e..03c60b2 100644 --- a/quick-install.sh +++ b/quick-install.sh @@ -60,6 +60,19 @@ get_config_value() { grep "^${key}" "$file" | head -1 | sed "s/^${key}[[:space:]]*=[[:space:]]*//" | tr -d '\r' } +ensure_prefix() { + local addr="$1" + local default_prefix="$2" + if [ -z "$addr" ]; then + echo "" + return 0 + fi + case "$addr" in + */*) echo "$addr" ;; + *) echo "${addr}${default_prefix}" ;; + esac +} + parse_warp_conf() { WG_URL=$(grep "^wg://" "$WARP_CONF" | head -1) @@ -98,6 +111,9 @@ parse_warp_conf() { IPV4=$(echo "$ADDRESS" | tr ',' '\n' | grep -v ':' | head -1 | tr -d ' ') IPV6=$(echo "$ADDRESS" | tr ',' '\n' | grep ':' | head -1 | tr -d ' ') + IPV4=$(ensure_prefix "$IPV4" "/32") + IPV6=$(ensure_prefix "$IPV6" "/128") + if [ -z "$IPV6" ]; then IPV6="2606:4700:110:8b6d:3808:7d65:ef2f:cc5d/128" fi