diff --git a/tools/cibsecret.in b/tools/cibsecret.in index 9b74ba3..dabbfc0 100644 --- a/tools/cibsecret.in +++ b/tools/cibsecret.in @@ -162,28 +162,28 @@ check_env() { } # This must be called (and return success) before calling $rsh or $rcp_to_from -get_live_nodes() { - # Get a list of all cluster nodes +get_live_peers() { + # Get a list of all other cluster nodes GLN_ALL_NODES="$(crm_node -l | awk '{print $2}' | grep -v "$(uname -n)")" # Make a list of those that respond to pings if [ "$(id -u)" = "0" ] && which fping >/dev/null 2>&1; then - LIVE_NODES=$(fping -a $GLN_ALL_NODES 2>/dev/null) + LIVE_NODES=$(fping -a $GLP_ALL_PEERS 2>/dev/null) else LIVE_NODES="" - for GLN_NODE in $GLN_ALL_NODES; do \ - ping -c 2 -q "$GLN_NODE" >/dev/null 2>&1 && - LIVE_NODES="$LIVE_NODES $GLN_NODE" + for GLP_NODE in $GLP_ALL_PEERS; do \ + ping -c 2 -q "$GLP_NODE" >/dev/null 2>&1 && + LIVE_NODES="$LIVE_NODES $GLP_NODE" done fi # Warn the user about any that didn't respond to pings - GLN_DOWN="$( (for GLN_NODE in $LIVE_NODES $GLN_ALL_NODES; do echo "$GLN_NODE"; done) | sort | uniq -u)" - if [ "$(echo "$GLN_DOWN" | wc -w)" = "1" ]; then - warn "node $GLN_DOWN is down" + GLP_DOWN="$( (for GLP_NODE in $LIVE_NODES $GLP_ALL_PEERS; do echo "$GLP_NODE"; done) | sort | uniq -u)" + if [ "$(echo "$GLP_DOWN" | wc -w)" = "1" ]; then + warn "node $GLP_DOWN is down" warn "you'll need to update it using \"$PROG sync\" later" - elif [ -n "$GLN_DOWN" ]; then - warn "nodes $(echo "$GLN_DOWN" | tr '\n' ' ')are down" + elif [ -n "$GLP_DOWN" ]; then + warn "nodes $(echo "$GLP_DOWN" | tr '\n' ' ')are down" warn "you'll need to update them using \"$PROG sync\" later" fi @@ -235,7 +235,7 @@ scp_fun() { # TODO: this procedure should be replaced with csync2 # provided that csync2 has already been configured sync_files() { - get_live_nodes || return + get_live_peers || return info "syncing $LRM_CIBSECRETS to $(echo "$LIVE_NODES" | tr '\n' ' ') ..." $rsh rm -rf "$LRM_CIBSECRETS" && $rsh mkdir -p "$(dirname "$LRM_CIBSECRETS")" && @@ -244,7 +244,7 @@ sync_files() { sync_one() { SO_FILE="$1" - get_live_nodes || return + get_live_peers || return info "syncing $SO_FILE to $(echo "$LIVE_NODES" | tr '\n' ' ') ..." $rsh mkdir -p "$(dirname "$SO_FILE")" && if [ -f "$SO_FILE" ]; then