summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Guegan <loic.guegan@mailbox.org>2024-01-21 11:07:50 +0100
committerLoic Guegan <loic.guegan@mailbox.org>2024-01-21 11:07:50 +0100
commitbcd7e7f5ff6e532c512c3c9ab43a65030417e63a (patch)
treee8459d9363e0a348a636a723bcdba54df500d21d
parent0d8b138f10f38e3b1e58ee02e50495c079c3df35 (diff)
Minor changes
-rw-r--r--.clusterman.sh.conf25
-rw-r--r--.clusterman_unique.sh6
-rw-r--r--.power_unique.sh11
3 files changed, 41 insertions, 1 deletions
diff --git a/.clusterman.sh.conf b/.clusterman.sh.conf
index da84dc7..cdde8e3 100644
--- a/.clusterman.sh.conf
+++ b/.clusterman.sh.conf
@@ -1,4 +1,27 @@
#!Usr/bin/env bash
declare -A nodes
-nodes["testbed-node-1"]="bbb1/2-0041" \ No newline at end of file
+
+# BBB1
+nodes["node-pi-1"]="bbb1/2-0041"
+nodes["node-pi-2"]="bbb1/2-0042"
+nodes["node-pi-3"]="bbb1/2-0043"
+nodes["node-pi-4"]="bbb1/2-0040"
+
+# BBB2
+nodes["node-pi-6"]="bbb2/2-0041"
+nodes["node-pi-8"]="bbb2/2-0047"
+nodes["node-pi-7"]="bbb2/2-004f"
+nodes["node-pi-5"]="bbb2/2-0040"
+
+# BBB3
+nodes["node-pi-9"]="bbb3/2-0048"
+nodes["node-pi-10"]="bbb3/2-0044"
+nodes["node-pi-11"]="bbb3/2-0045"
+nodes["node-pi-12"]="bbb3/2-0046"
+
+# BBB4
+nodes["node-pi-13"]="bbb4/2-0042"
+nodes["node-pi-14"]="bbb4/2-004b"
+nodes["node-pi-15"]="bbb4/2-0040"
+nodes["node-pi-16"]="bbb4/2-0049"
diff --git a/.clusterman_unique.sh b/.clusterman_unique.sh
new file mode 100644
index 0000000..bbaa936
--- /dev/null
+++ b/.clusterman_unique.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+# Load configuration
+wai=$(dirname $(readlink -f "$0")) # Current script directory
+
+$wai/.clusterman.sh $@ | $wai/.power_unique.sh
diff --git a/.power_unique.sh b/.power_unique.sh
new file mode 100644
index 0000000..25fb530
--- /dev/null
+++ b/.power_unique.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+
+tmp=$(mktemp)
+while IFS= read -r line; do
+ echo $line >> $tmp
+done
+
+last_line=$(cat $tmp | tail -n1)
+cat $tmp | awk -F"," 'BEGIN{LAST=-1;skipped=0} {if(LAST!=$3){print $1","$2","$3;skipped=0}else{skipped=1} LAST=$3} END{if(skipped){print "'$last_line'"}}'
+rm $tmp
+