1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-26 18:50:30 +03:00

Eventscripts: 10.interfaces clean-up - use more descriptive variable names.

The name of variable $ok gives no clue to its meaning/use so this
changes that variable to be named $up_interfaces_found.

The return logic relating to $ok and $fail is difficult to read, so
these variables are given true/fale values, allowing the return logic
to be simplified.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 3402930319d462eab5525410f6a676952e120182)
This commit is contained in:
Martin Schwenke 2011-06-28 16:10:23 +10:00
parent bb5db84021
commit 00c4cc6d22

View File

@ -18,13 +18,13 @@ loadconfig
mark_up ()
{
ok=1
up_interfaces_found=true
ctdb setifacelink $1 up >/dev/null 2>&1
}
mark_down ()
{
fail=1
fail=true
ctdb setifacelink $1 down >/dev/null 2>&1
}
@ -43,8 +43,8 @@ monitor_interfaces()
INTERFACES=`for IFACE in $INTERFACES $IFACES ; do echo $IFACE ; done | sort | uniq`
fail=0
ok=0
fail=false
up_interfaces_found=false
for IFACE in $INTERFACES ; do
ip addr show $IFACE 2>/dev/null >/dev/null || {
@ -109,15 +109,11 @@ monitor_interfaces()
done
test x"$fail" = x"0" && {
return 0;
}
$fail || return 0
test x"$ok" = x"1" && {
return 2;
}
$up_interfaces_found && return 2
return 1;
return 1
}
case "$1" in