mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-02-18 02:25:27 +01:00
wireguard-tools: fix script errors
follow-up to148207730aSchoolboy 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> (cherry picked from commit3f0de6a28d) Link: https://github.com/openwrt/openwrt/pull/21840 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
parent
436b090bc7
commit
85342bea07
1 changed files with 2 additions and 2 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue