mirror of
https://github.com/samba-team/samba.git
synced 2025-01-25 06:04:04 +03:00
3902855275
update the makefile and rpm to install 99.routing (This used to be ctdb commit c0b3bd8a3fa580dca5afa97c8012fccb25231373)
38 lines
752 B
Bash
Executable File
38 lines
752 B
Bash
Executable File
#!/bin/sh
|
|
# script to add entries to the routing table after we have performed a
|
|
# take ip event
|
|
# (when we do a "releaseip" event and remove an ip address from an interface
|
|
# the kernel might automatically remove associated entries from
|
|
# the routing table. This is where we add them back)
|
|
#
|
|
# Routes to add are defined in /etc/ctdb/static-routes.
|
|
# Syntax is :
|
|
# IFACE NET/MASK GATEWAY
|
|
#
|
|
# Example
|
|
# bond1 10.3.3.0/24 10.0.0.1
|
|
|
|
. $CTDB_BASE/functions
|
|
loadconfig ctdb
|
|
|
|
[ -f $CTDB_BASE/static-routes ] || {
|
|
exit 0
|
|
}
|
|
|
|
cmd="$1"
|
|
shift
|
|
PATH=/usr/bin:/bin:/usr/sbin:/sbin:$PATH
|
|
|
|
case $cmd in
|
|
takeip)
|
|
iface=$1
|
|
cat $CTDB_BASE/static-routes | egrep "^$iface " | while read IFACE DEST GW; do
|
|
route add -net $DEST gw $GW
|
|
done
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
exit 0
|