From: Martin Schwenke Date: Wed, 6 Jul 2016 10:14:03 +0000 (+1000) Subject: ctdb-scripts: Avoid shellcheck warning SC2017 (arithmetic precision) X-Git-Tag: tdb-1.3.10~268 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fc858a13e71c30046d35d40b085f172aaa191048;p=thirdparty%2Fsamba.git ctdb-scripts: Avoid shellcheck warning SC2017 (arithmetic precision) SC2017: Increase precision by replacing a/b*c with a*c/b. This code intentionally rounds to an even value. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/config/statd-callout b/ctdb/config/statd-callout index 74402107ffd..ce7d63997d3 100755 --- a/ctdb/config/statd-callout +++ b/ctdb/config/statd-callout @@ -119,6 +119,8 @@ case "$1" in # We use epoch and hope the nodes are close enough in clock. # Even numbers mean service is shut down, odd numbers mean # service is started. + # Intentionally round to an even number + # shellcheck disable=SC2017 state_even=$(( $(date '+%s') / 2 * 2)) # We must also let some time pass between stopping and