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