Commit 9a05511a authored by remy's avatar remy
Browse files

This closes #1 : all results have timestamp now

parent 7b1a1695
......@@ -36,6 +36,7 @@
CURDIR=`pwd`
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKDIR=${DIR}/workdir
DATE=`date '+%Y%m%d_%H%M%S'`
# path to commands; could be useful for crons
CURL=`command -v curl`
......@@ -145,6 +146,14 @@ else
CURL_OPTS="-Iks"
fi
if [ -z "${OUTPUT_DIR}" ]; then
OUTPUT_DIR="${DIR}/results"
fi
if [ ! -d ${OUTPUT_DIR} ]; then
mkdir -p ${OUTPUT_DIR};
fi
OUTPUT_CHECKSUMS="${OUTPUT_DIR}/${DATE}_checksums.json"
OUTPUT_STATUS="${OUTPUT_DIR}/${DATE}_status.json"
if [[ "$1" == "compare" ]]; then
cd ${WORKDIR}
......@@ -242,4 +251,11 @@ echo "{" > status.json
$AWK -v total=$total '{ if ($NF=="200") {$NF="OK";} if (NR==total) {print "\t\""$1"\": \""$NF"\"";} else {print "\t\""$1"\": \""$NF"\",";} }' status.log >> status.json
echo "}" >> status.json
# change current directory to $DIR b/c of issues with relative paths in profile.conf
cd ${DIR}
cp ${WORKDIR}/status.json ${OUTPUT_STATUS}
if [ -f ${WORKDIR}/checksums.json ]; then
cp ${WORKDIR}/checksums.json ${OUTPUT_CHECKSUMS}
fi
cd ${CURDIR}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment