From: Martin Schwenke Date: Mon, 9 Jan 2017 04:19:26 +0000 (+1100) Subject: ctdb-scripts: Drop function ctdb_check_command() X-Git-Tag: talloc-2.1.9~383 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9870538c9876072bcd4b5f9b907a256d8737249;p=thirdparty%2Fsamba.git ctdb-scripts: Drop function ctdb_check_command() This is only used in 1 place, so just inline the check. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/config/events.d/49.winbind b/ctdb/config/events.d/49.winbind index c9d7aca2bc9..5e937378295 100755 --- a/ctdb/config/events.d/49.winbind +++ b/ctdb/config/events.d/49.winbind @@ -48,7 +48,11 @@ shutdown) ;; monitor) - ctdb_check_command wbinfo -p + if ! out=$(wbinfo -p 2>&1) ; then + echo "ERROR: wbinfo -p returned error" + echo "$out" + exit 1 + fi ;; esac diff --git a/ctdb/config/functions b/ctdb/config/functions index 44e542ae11c..9b0c3207533 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -408,21 +408,6 @@ ctdb_check_unix_socket() { fi } -###################################################### -# check a command returns zero status -# usage: ctdb_check_command -###################################################### -ctdb_check_command () -{ - _out=$("$@" 2>&1) || { - echo "ERROR: $* returned error" - if [ -n "$_out" ] ; then - debug "$_out" - fi - exit 1 - } -} - ################################################ # kill off any TCP connections with the given IP ################################################