summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2011-06-28 15:36:28 +1000
committerMartin Schwenke <martin@meltin.net>2011-08-03 19:58:25 +1000
commit4b516600a2dc5cc61cbd9a2a61ba6be047854a12 (patch)
treeb2e38c3bc0fad6e0afed87c0348fbbac3f9696d1
parentcfdccc5cac16af6063f44161dfbecc7cf9038441 (diff)
downloadsamba-4b516600a2dc5cc61cbd9a2a61ba6be047854a12.tar.gz
samba-4b516600a2dc5cc61cbd9a2a61ba6be047854a12.tar.xz
samba-4b516600a2dc5cc61cbd9a2a61ba6be047854a12.zip
Eventscripts: update 10.interface to use set_proc() and get_proc().
Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 61b7f0172ba5c83c847c29fac3582c25c7754b68)
-rwxr-xr-xctdb/config/events.d/10.interface16
1 files changed, 8 insertions, 8 deletions
diff --git a/ctdb/config/events.d/10.interface b/ctdb/config/events.d/10.interface
index ecaa323c5e..4c02229394 100755
--- a/ctdb/config/events.d/10.interface
+++ b/ctdb/config/events.d/10.interface
@@ -46,14 +46,14 @@ monitor_interfaces()
# When we use VLANs for bond interfaces, there will only
# be an entry in /proc for the underlying real interface
local REALIFACE=`echo $IFACE |sed -e 's/\..*$//'`
- [ -f /proc/net/bonding/$REALIFACE ] && {
- grep -q 'Currently Active Slave: None' /proc/net/bonding/$REALIFACE && {
+ get_proc "net/bonding/$REALIFACE" >/dev/null 2>&1 && {
+ get_proc "net/bonding/$REALIFACE" | grep -q 'Currently Active Slave: None' && {
echo "ERROR: No active slaves for bond device $REALIFACE"
fail=1
ctdb setifacelink $IFACE down >/dev/null 2>/dev/null
continue;
}
- grep -q '^MII Status: up' /proc/net/bonding/$REALIFACE || {
+ get_proc "net/bonding/$REALIFACE" | grep -q '^MII Status: up' || {
echo "ERROR: public network interface $REALIFACE is down"
fail=1
ctdb setifacelink $IFACE down >/dev/null 2>/dev/null
@@ -124,8 +124,8 @@ case "$1" in
init)
# make sure that we only respond to ARP messages from the NIC where
# a particular ip address is associated.
- [ -f /proc/sys/net/ipv4/conf/all/arp_filter ] && {
- echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter
+ get_proc sys/net/ipv4/conf/all/arp_filter >/dev/null 2>&1 && {
+ set_proc sys/net/ipv4/conf/all/arp_filter 1
}
;;
@@ -164,7 +164,7 @@ case "$1" in
iptables -D INPUT -i $iface -d $ip -j DROP 2> /dev/null
# flush our route cache
- echo 1 > /proc/sys/net/ipv4/route/flush
+ set_proc sys/net/ipv4/route/flush 1
;;
@@ -204,7 +204,7 @@ case "$1" in
iptables -D INPUT -i $iface -d $ip -j DROP 2> /dev/null
# flush our route cache
- echo 1 > /proc/sys/net/ipv4/route/flush
+ set_proc sys/net/ipv4/route/flush 1
;;
##################################################
@@ -248,7 +248,7 @@ case "$1" in
iptables -D INPUT -i $oiface -d $ip -j DROP 2> /dev/null
# flush our route cache
- echo 1 > /proc/sys/net/ipv4/route/flush
+ set_proc sys/net/ipv4/route/flush 1
# propagate the new mac address
ctdb gratiousarp $ip $niface