smbd: Clarify smb2 lock checks
[Samba.git] / ctdb / config / events.d / 11.routing
blob2fe560f73f1a14996470465056b45eb184503b60
1 #!/bin/sh
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
16 # Example:
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
24 loadconfig
26 [ -f $CTDB_BASE/static-routes ] || {
27 exit 0
30 case "$1" in
31 ipreallocated)
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"
37 updateip)
38 oiface=$2
39 niface=$3
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 "$@"
50 esac
52 exit 0