hw-test/scripts/scan-dmidecode

20 lines
437 B
Bash
Executable file

#!/bin/bash
MY_SERIAL=`dmidecode -s chassis-serial-number`
MY_DATETIME=`date +%Y-%m-%d_%H-%M-%S`
OUTPUT_HOME=/output/hwtests
OUTPUT_DIR=$OUTPUT_HOME/$MY_SERIAL
SNAPSHOT_D=$OUTPUT_HOME/snapshot/$MY_SERIAL/$MY_DATETIME
export OUTPUT_DIR
export SNAPSHOT_D
mkdir -p $OUTPUT_DIR
if [ ! -f $OUTPUT_DIR/dmidecode ] ; then
dmidecode > $OUTPUT_DIR/dmidecode
fi
function snapshot {
mkdir -vp $SNAPSHOT_D
cp -af $OUTPUT_DIR/* $SNAPSHOT_D/
}