diff options
| author | Loic Guegan <loic.guegan@mailbox.org> | 2024-02-02 15:44:38 +0100 |
|---|---|---|
| committer | Loic Guegan <loic.guegan@mailbox.org> | 2024-02-02 15:44:38 +0100 |
| commit | d27e0e652be350812db28b67400cda055eea8dbd (patch) | |
| tree | 3be876aac32af12796ed217689df9ba56be369cb | |
| parent | 9ba1763b4f1b4aa5e65fc45a0dc5eef620b1d4ee (diff) | |
Minor changes
| -rw-r--r-- | .clusterman_onoff.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/.clusterman_onoff.sh b/.clusterman_onoff.sh new file mode 100644 index 0000000..2f951d8 --- /dev/null +++ b/.clusterman_onoff.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# This script assumes that the keys used by publishers +# corresponds to the UNIQUE hostname of each monitored node + +# Check parameters +[ $# -ne 1 ] && { echo "Usage: $0 [on|off]"; exit 1; } +if [ "$1" != "on" ] +then + [ "$1" != "off" ] && { echo "Usage: $0 [on|off]"; exit 1; } +fi + +# Load configuration +wai=$(dirname $(readlink -f "$0")) # Current script directory +source ${wai}/config.mk +source ${wai}/.clusterman.sh.conf + +# Loop over names +for value in "${nodes[@]}"; do + node=$(echo "$value"|cut -d "/" -f 1) + ina260=$(echo "$value"|cut -d "/" -f 2) + ip=$(clusterman node list -g $node) + [ "$1" == "off" ] && ssh testbed@${ip} touch ina260-zmq-publisher/publisher_${ina260}_break + [ "$1" == "on" ] && ssh testbed@${ip} rm -f ina260-zmq-publisher/publisher_${ina260}_break +done |
