Add a hook to allow the network name to be hacked
authorMartin Schwenke <martin@meltin.net>
Tue, 16 Jul 2013 06:07:46 +0000 (16:07 +1000)
committerMartin Schwenke <martin@meltin.net>
Tue, 16 Jul 2013 06:22:54 +0000 (16:22 +1000)
Signed-off-by: Martin Schwenke <martin@meltin.net>
autocluster

index 37681a89807dee7d94031b2e1287cb32f1aab217..df4ed57d76065e8d514afcbbf89c04e15efaaad1 100755 (executable)
@@ -273,6 +273,8 @@ create_node_null () {
     :
 }
 
+hack_network_map_hooks=""
+
 # Uses: CLUSTER, NAME, NETWORKS, FIRSTIP, ip_offset
 make_network_map ()
 {
@@ -302,6 +304,12 @@ make_network_map ()
 
        local ip="${net%.*}.${IPNUM}"
        local mask="255.255.255.0"
+
+       # This can be used to override the variables in the echo
+       # statement below.  The hook can use any other variables
+       # available in this function.
+       run_hooks hack_network_map_hooks
+
        echo "${netname} ${dev} ${ip} ${mask} ${mac} ${opts}"
        count=$(($count + 1))
     done >"$network_map"