Skip to content

Commit bfe79d9

Browse files
committed
Add a readme to the generated reports
1 parent d42af9f commit bfe79d9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

testing/report.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ OLDPWD="${PWD}"
3333
SCRIPT_PATH="${BASH_SOURCE[0]}"
3434
SCRIPT_DIR="$( cd "$( dirname "${SCRIPT_PATH}" )" &> /dev/null && pwd )"
3535
GIT_DIR="$(dirname "$(dirname "${SCRIPT_DIR}")")"
36-
export DIR="${SCRIPT_DIR}/report"
36+
DIR="${SCRIPT_DIR}/report"
37+
TIMESTAMP="$(date '+%Y-%m-%d_%H-%M-%S')"
3738

3839
if [ -z "${DIR}" ]; then
3940
echo "Could not configure directory variable: ${DIR}"
@@ -106,6 +107,7 @@ if [ "$(ls -A $DIR)" ]; then
106107
fi
107108
mkdir -p "${DIR}/hdparm" "${DIR}/smartctl"
108109
cp "${SCRIPT_PATH}" "${DIR}"
110+
sed "s/HOST/$(hostname)/g; s/TIMESTAMP/${TIMESTAMP}/g" "${SCRIPT_DIR}/report_readme_template.txt" > "${DIR}/README.txt"
109111

110112
# Basic info
111113
echo "Basic info:"
@@ -351,6 +353,6 @@ fi
351353

352354
if [ "${REPORT}" = true ]; then
353355
# Packaging
354-
7zr a -mx=9 "${DIR}_$(date '+%Y-%m-%d_%H-%M-%S').7z" "${DIR}"
356+
7zr a -mx=9 "${DIR}_${TIMESTAMP}.7z" "${DIR}"
355357
echo "The report is ready."
356358
fi

testing/report_readme_template.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This report was created on HOST at TIMESTAMP using Mika's reporting script:
2+
https://github.com/AgenttiX/linux-scripts/blob/master/testing/report.sh

0 commit comments

Comments
 (0)