3 # Attempt to add a set of static routes.
5 # Do this in "ipreallocated" rather than just "startup" because some
6 # of the routes might be missing because the corresponding interface
7 # has not previously had any IPs assigned or IPs were previously
8 # released and corresponding routes were dropped.
10 # Addition of some routes might fail, errors go to /dev/null.
12 # Routes to add are defined in $CTDB_BASE/static-routes. Syntax is:
14 # IFACE NET/MASK GATEWAY
18 # bond1 10.3.3.0/24 10.0.0.1
20 [ -n "$CTDB_BASE" ] || \
21 export CTDB_BASE
=$
(cd -P $
(dirname "$0") ; dirname "$PWD")
23 .
$CTDB_BASE/functions
26 [ -f $CTDB_BASE/static-routes
] ||
{
32 while read iface dest gw
; do
33 ip route add
"$dest" via
"$gw" dev
"$iface" >/dev
/null
2>&1
34 done <"${CTDB_BASE}/static-routes"
40 while read iface dest gw
; do
41 if [ "$niface" = "$iface" -o "$oiface" = "$iface" ] ; then
42 ip route add
"$dest" via
"$gw" dev
"$iface" >/dev
/null
2>&1
44 done <"${CTDB_BASE}/static-routes"
48 ctdb_standard_event_handler
"$@"