From a9870538c9876072bcd4b5f9b907a256d8737249 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Mon, 9 Jan 2017 15:19:26 +1100 Subject: [PATCH] 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 --- ctdb/config/events.d/49.winbind | 6 +++++- ctdb/config/functions | 15 --------------- 2 files changed, 5 insertions(+), 16 deletions(-) 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 ################################################ -- 2.47.2