Check if needed software is installed.

Closes #1.
This commit is contained in:
JensKuehnel 2018-01-27 17:09:52 +01:00 • committed by dak180
parent 9aeda18f63
commit abfee5743d
No known key found for this signature in database
GPG key ID: 6E2DC12780B8BB51

View file

@ -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