_state_even=$(($(date '+%s') / 2 * 2))
_prev=""
- while read _sip _cip; do
+ while read -r _sip _cip; do
# NOTE: Consider optimising smnotify to read all the
# data from stdin and then run it in the background.
delete_records()
{
- while read _sip _cip; do
+ while read -r _sip _cip; do
_key="statd-state@${_sip}@${_cip}"
echo "\"${_key}\" \"\""
done | $CTDB ptrans "ctdb.tdb"
# shellcheck disable=SC2034
$CTDB ip -X |
tail -n +2 |
- while IFS="|" read x sip node x; do
+ while IFS="|" read -r x sip node x; do
[ "$node" = "$pnn" ] || continue # not us
key="statd-state@${sip}@${cip}"
echo "\"${key}\" \"${date}\"" >"$key"
# shellcheck disable=SC2034
$CTDB ip -X |
tail -n +2 |
- while IFS="|" read x sip node x; do
+ while IFS="|" read -r x sip node x; do
[ "$node" = "$pnn" ] || continue # not us
key="statd-state@${sip}@${cip}"
echo "\"${key}\" \"\"" >"$key"
# There's nothing else we can do with them at this stage.
echo "$ctdb_all_ips" |
awk -v pnn="$pnn" 'pnn != $2 { print $1 }' |
- while read sip; do
+ while read -r sip; do
rm -f "statd-state@${sip}@"*
done
;;