Due to output of other functions changed, this function
needed to be slightly rewritten.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
}
pppoe_server_poolfile() {
- local file=${1}
+ local file="${1}"
assert isset file
- local subnet=${2}
+ local subnet="${2}"
assert isset subnet
- config_header "PPPoE server IP address pool file" > ${file}
+ (
+ config_header "PPPoE server IP address pool file"
+
+ i=0
+ for addr in $(ipv4_range_explicit "${subnet}"); do
+ (( i++ ))
- # The network address will be the gateway address.
- local netaddr=$(ipv4_get_network ${subnet})
+ # Skip the first address which is being used for the gateway
+ [ ${i} -eq 1 ] && continue
- local addr
- for addr in $(ipv4_range_explicit ${subnet}); do
- [ "${addr}" = "${netaddr}" ] && continue
- print "${addr}"
- done >> ${file}
+ print "${addr}"
+ done
+ ) > ${file}
return ${EXIT_OK}
}