From abfee5743dea32c65ce6673feefbf1a7e4c4ef31 Mon Sep 17 00:00:00 2001 From: JensKuehnel Date: Sat, 27 Jan 2018 17:09:52 +0100 Subject: [PATCH] Check if needed software is installed. Closes #1. --- disk-burnin.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/disk-burnin.sh b/disk-burnin.sh index dba71fd..71f2193 100755 --- a/disk-burnin.sh +++ b/disk-burnin.sh @@ -190,7 +190,13 @@ if [ -z "${driveID}" ]; then exit 4 fi - +#check if needed software is installed +for command in grep pcregrep awk sed tr sleep badblocks; do + if ! type "${command}" &> /dev/null; then + echo "${command} is missing, please install" + exit 100 + fi +done ###################################################################### # @@ -477,4 +483,3 @@ if [ "${osflavor}" = "FreeBSD" ]; then sed -i '' -e '/Vendor Specific SMART/d' "${Log_File}" sed -i '' -e '/SMART Error Log Version/d' "${Log_File}" fi -