From: Martin Schwenke Date: Tue, 5 Jul 2016 10:09:12 +0000 (+1000) Subject: ctdb-scripts: Fix a bug in counter checking X-Git-Tag: tdb-1.3.10~287 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=91eb421690eade356b0a833ca53d6fadfc3c37ae;p=thirdparty%2Fsamba.git 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 Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/config/functions b/ctdb/config/functions index 64b7c012d90..8f0b790983c 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -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")