diff --git a/disks_checks.sh b/disks_checks.sh index f89f3c9..8c9cf09 100755 --- a/disks_checks.sh +++ b/disks_checks.sh @@ -66,12 +66,10 @@ mounted_btrfs_partitions="$(mount | grep btrfs | awk '{print $3}' | tr '\n' ',' for i in ${mounted_btrfs_partitions//,/ } do - # check btrfs errors on mounted device, if all output is 0 then return a single "1" + # check btrfs errors on mounted device, if all output is 0 then return a single "1" if 2 disks raid 1, or a 0 if single disk check_disk_errors=$(btrfs device stats $i | awk '{print $2}' | grep -c 0 -v) - if [ ${check_disk_errors} -eq 1 ] ; then - : # do nothing if output is a single "1" - else + if [ ${check_disk_errors} -gt 1 ] ; then echo Bad: - Btrfs is detecting errors on partition $i, some disk is about to be broken echo Sending alert... curl -k --retry 3 \