From: Michael Tremer Date: Thu, 25 Apr 2024 18:20:13 +0000 (+0200) Subject: wireguard: Rename routes to remote subnets X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f0a4cae5e82fe9011d41a17d359419b528c80415;p=ipfire-2.x.git wireguard: Rename routes to remote subnets Signed-off-by: Michael Tremer --- diff --git a/src/initscripts/system/wireguard b/src/initscripts/system/wireguard index 95dcfa23a..daadcb73b 100644 --- a/src/initscripts/system/wireguard +++ b/src/initscripts/system/wireguard @@ -44,14 +44,14 @@ generate_config() { local pubkey local endpoint local port - local routes + local remote_subnets local remarks local local_subnets local psk local keepalive local _rest - local route + local subnet # Flush all previously set routes ip route flush dev "${INTF}" @@ -61,7 +61,7 @@ generate_config() { ip route add "${CLIENT_POOL}" dev "${INTF}" fi - while read -r id enabled type name pubkey endpoint port routes \ + while read -r id enabled type name pubkey endpoint port remote_subnets \ remarks local_subnets psk keepalive _rest; do # Skip peers that are not enabled [ "${enabled}" = "on" ] || continue @@ -80,13 +80,13 @@ generate_config() { fi # Set routes - if [ -n "${routes}" ]; then - echo "AllowedIPs = ${routes//|/, }" + if [ -n "${remote_subnets}" ]; then + echo "AllowedIPs = ${remote_subnets//|/, }" # Apply the routes if [ "${type}" = "net" ]; then - for route in ${routes//|/,}; do - ip route add "${route}" dev "${INTF}" + for subnet in ${remote_subnets//|/,}; do + ip route add "${subnet}" dev "${INTF}" done fi fi