1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

ctdb-scripts: Fix a bug in counter checking

If there are insufficient arguments then they can't be shifted.

This function will be removed shortly.  However, it needs to work for
now as tests will be added that depend on it to work.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2016-07-05 20:09:12 +10:00 committed by Amitay Isaacs
parent 5437fdcffb
commit 91eb421690

View File

@ -769,7 +769,11 @@ ctdb_check_counter () {
_msg="${1:-error}" # "error" - anything else is silent on fail
_op="${2:--ge}" # an integer operator supported by test
_limit="${3:-${service_fail_limit}}"
shift 3
if [ $# -le 3 ] ; then
shift $#
else
shift 3
fi
_size=$(ctdb_counter_get "$1")