diff options
| author | Loic Guegan <loic.guegan@mailbox.org> | 2023-11-21 11:39:40 +0100 |
|---|---|---|
| committer | Loic Guegan <loic.guegan@mailbox.org> | 2023-11-21 11:39:40 +0100 |
| commit | bbef37985a1fe370c6f8613f54c7daa70af4acce (patch) | |
| tree | 1f5b7a02471d2d8dbfe4b9473e9e50964e2b1849 | |
| parent | 47c5bc6d081597f1963b8cf43722b98a7c8fc1c9 (diff) | |
Minor changes
| -rwxr-xr-x | .clusterman.sh | 11 | ||||
| -rw-r--r-- | .clusterman.sh.conf | 4 |
2 files changed, 9 insertions, 6 deletions
diff --git a/.clusterman.sh b/.clusterman.sh index 8da5146..8233eeb 100755 --- a/.clusterman.sh +++ b/.clusterman.sh @@ -13,19 +13,18 @@ to=$3 # Load configuration wai=$(dirname $(readlink -f "$0")) # Current script directory source ${wai}/config.mk +source ${wai}/clusterman.sh.conf # Compute intervals ifrom=$(echo $from $LOG_INTERVAL | awk '{print($1-($1%$2))}') ito=$(echo $to $LOG_INTERVAL | awk '{print($1-($1%$2))}') # Search for power measurements -nfolder=$(readlink -f ${wai}/${SUBSCRIBER_DIR}/$key/) # Node Folder +nfolder=$(readlink -f ${wai}/${SUBSCRIBER_DIR}/${nodes[$key]}/) # Node Folder [ ! -d "$nfolder" ] && { echo "Node \"$key\" has not power measurements."; exit 2; } -cfolder=${nfolder}/$(ls $nfolder/|head -n1)/ # Client FOlder -[ ! -d "$cfolder" ] && { echo "Node \"$key\" has no client folder yet."; exit 3; } # Set from file and to file -ffile=${cfolder}/$ifrom -tfile=${cfolder}/$ito +ffile=${nfolder}/$ifrom +tfile=${nfolder}/$ito [ ! -f "$ffile" ] && { echo "Node power measurements starting at $2."; exit 4; } [ ! -f "$tfile" ] && { echo "Node power measurements up to $3."; exit 5; } # Give files to the user @@ -33,7 +32,7 @@ missings=0 header=0 for interval in $(seq $ifrom $LOG_INTERVAL $ito) do - file=${cfolder}/${interval} + file=${nfolder}/${interval} if [ ! -f "$file" ] then missings=$(( missings + 1 )) diff --git a/.clusterman.sh.conf b/.clusterman.sh.conf new file mode 100644 index 0000000..da84dc7 --- /dev/null +++ b/.clusterman.sh.conf @@ -0,0 +1,4 @@ +#!Usr/bin/env bash + +declare -A nodes +nodes["testbed-node-1"]="bbb1/2-0041"
\ No newline at end of file |
