false
}
-# Build public address configuration.
-# * 1st public IP: unless specified, last octet is $FIRSTIP + $PUBLIC_IP_OFFSET
-# * Excluded nodes: unless specified via comma-separated list of IP offsets,
-# nodes are excluded via their node types
-# * Number of public addresses per interface is either specified or $NUMNODES.
-make_public_addresses_old () {
- local firstip="${1:-$(($FIRSTIP + $PUBLIC_IP_OFFSET))}"
- local excluded_nodes="$2"
- local num_addrs="${3:-${NUMNODES}}"
-
- # For delimiting matches.
- excluded_nodes="${excluded_nodes:+,}${excluded_nodes}${excluded_nodes:+,}"
- # Avoid spaces
- excluded_nodes="${excluded_nodes// /}"
-
- make_public_addresses_for_node ()
- {
- [ "$ctdb_node" = 1 ] || return 0
-
- echo "[/etc/ctdb/public_addresses:${name}.${DOMAIN}]"
-
- if [ -n "$excluded_nodes" -a \
- "${excluded_nodes/,${ip_offset},}" = "$excluded_nodes" ] ||
- ([ -z "$excluded_nodes" ] &&
- call_func has_public_addresses "$node_type") ; then
-
- local e i
- for e in $IPNET1 $IPNET2 ; do
- for i in $(seq $firstip $(($firstip + $num_addrs - 1))) ; do
- if [ $i -gt 254 ] ; then
- die "make_public_addresses: octet > 254 - consider setting PUBLIC_IP_OFFSET"
- fi
- printf "\t${IPBASE}.${e}.${i}/24 eth${e}\n"
- done
- done
- fi
- echo
- }
- hack_all_nodes_with make_public_addresses_for_node
-}
-
make_public_addresses() {
local firstip="${1:-$[${FIRSTIP} + ${PUBLIC_IP_OFFSET}]}"
local num_addrs="${2:-${NUMNODES}}"
- if [ $[ $firstip + $num_addrs - 1 ] -gt 254 ]; then
+ if [ $(( $firstip + $num_addrs - 1 )) -gt 254 ]; then
die "make_public_addresses: last octet > 254 - change PUBLIC_IP_OFFSET"
fi
local e
- for e in $IPNET0 $IPNET1 $IPNET2 ; do
+ for e in $IPNET1 $IPNET2 ; do
echo -ne "${IPBASE}.${e}.${firstip},${num_addrs},eth${e} "
done
echo