Change all callers to maintain current behaviour.
Signed-off-by: Martin Schwenke <martin@meltin.net>
[ -f "$CTDB_PUBLIC_ADDRESSES" ] || \
die "No public addresses file found. Can't clean up."
-drop_all_public_ips "ctdb-crash-cleanup.sh"
+drop_all_public_ips 2>&1 | script_log "ctdb-crash-cleanup.sh"
if [ -n "$CTDB_NATGW_PUBLIC_IP" ] ; then
drop_ip "$CTDB_NATGW_PUBLIC_IP" "ctdb-crash-cleanup.sh"
# make sure we drop any ips that might still be held if previous
# instance of ctdb got killed with -9 or similar
- drop_all_public_ips "ctdb.init"
+ drop_all_public_ips 2>&1 | script_log "ctdb.init"
if select_tdb_checker ; then
check_persistent_databases || return $?
}
done
# make sure all ips are dropped, pfkill -9 might leave them hanging around
- drop_all_public_ips
+ drop_all_public_ips >/dev/null 2>&1
rm -f "$pidfile"
drop_ip ()
{
_addr="${1%/*}" # Remove optional maskbits
- _log_tag="$2"
set -- $(ip_maskbits_iface $_addr)
if [ -n "$1" ] ; then
_maskbits="$1"
_iface="$2"
- if [ -n "$_log_tag" ] ; then
- script_log "$_log_tag" \
- "Removing public address $_addr/$_maskbits from device $_iface"
- fi
+ echo "Removing public address $_addr/$_maskbits from device $_iface"
ip addr del $_addr/$_maskbits dev $_iface >/dev/null 2>&1
fi
}
drop_all_public_ips ()
{
- _log_tag="$1"
-
while read _ip _x ; do
- drop_ip "$_ip" "$_log_tag"
+ drop_ip "$_ip"
done <"${CTDB_PUBLIC_ADDRESSES:-/dev/null}"
}