Add error check to not leak logs with syntax errors in case of failed

`zpool history`.

MFC after:	1 month
This commit is contained in:
Alexander Motin 2016-02-05 17:28:11 +00:00
parent c80429cedb
commit b0fcd5fba2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=295324

View File

@ -63,6 +63,11 @@ case "$daily_scrub_zfs_enable" in
_last_scrub=$(zpool history ${pool} | \
sed -ne '2s/ .*$//p')
fi
if [ -z "${_last_scrub}" ]; then
echo " skipping scrubbing of pool '${pool}':"
echo " can't get last scrubbing date"
continue
fi
# Now minus last scrub (both in seconds) converted to days.
_scrub_diff=$(expr -e \( $(date +%s) - \