]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
wireguard-tools: fix script errors 21851/head
authorPaul Donald <newtwen+github@gmail.com>
Tue, 3 Feb 2026 05:18:01 +0000 (06:18 +0100)
committerRobert Marko <robimarko@gmail.com>
Tue, 3 Feb 2026 09:02:31 +0000 (10:02 +0100)
follow-up to 148207730a3c9f3aea807df336ca33792e9d3c0f

Schoolboy error on the peer_psk value.

Also fix an issue when joining peer IPv4 and IPv6 AllowedIPs
(${peer_a_ips/ /, } replaces only the first space, while
${peer_a_ips// /, } replaces all the spaces).

Closes: https://github.com/openwrt/openwrt/issues/21847
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21851
Signed-off-by: Robert Marko <robimarko@gmail.com>
package/network/utils/wireguard-tools/files/wireguard.sh

index 738714e1c6bd424840731db376913fbbb78db4a6..fa8e2142b58c4498098aa33dfcc2ac77b975c17c 100644 (file)
@@ -84,7 +84,7 @@ proto_wireguard_setup() {
                config_get peer_port "$section" "endpoint_port" "51820"
                config_get peer_a_ips "$section" "allowed_ips"
                config_get peer_p_ka "$section" "persistent_keepalive"
-               config_get peer_psk "$section" "peer_psk"
+               config_get peer_psk "$section" "preshared_key"
 
 
                [ "${peer_eph##*:}" != "$peer_eph" ] && peer_eph="[$peer_eph]"
@@ -94,7 +94,7 @@ proto_wireguard_setup() {
                [ -n "${peer_key}" ]    && peer_block="${peer_block}PublicKey=${peer_key}\n"
                [ -n "${peer_psk}" ]    && peer_block="${peer_block}PresharedKey=${peer_psk}\n"
                [ -n "${peer_eph}" ]    && peer_block="${peer_block}Endpoint=${peer_eph}${peer_port:+:$peer_port}\n"
-               [ -n "${peer_a_ips}" ]  && peer_block="${peer_block}AllowedIPs=${peer_a_ips/ /, }\n"
+               [ -n "${peer_a_ips}" ]  && peer_block="${peer_block}AllowedIPs=${peer_a_ips// /, }\n"
                [ -n "${peer_p_ka}" ]   && peer_block="${peer_block}PersistentKeepalive=${peer_p_ka}\n"
 
                [ -n "$peer_key" ] && peer_config="$peer_config$peer_block\n"