]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
wireguard: Rename routes to remote subnets
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 25 Apr 2024 18:20:13 +0000 (20:20 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 22 Apr 2025 14:48:32 +0000 (16:48 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/system/wireguard

index 95dcfa23ab339769910b619a5e47ef762920f1a3..daadcb73b3b246310be9baf87a8ac00433733741 100644 (file)
@@ -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