dotfiles/.config/scripts/disk_check.sh

16 lines
414 B
Bash
Raw Normal View History

2024-03-15 18:18:13 +01:00
#!/bin/sh
REPORT_EMAIL=email@thomasave.be
ZPOOL_STATUS=`zpool status -x`
if [ "$ZPOOL_STATUS" = "all pools are healthy" -o "$ZPOOL_STATUS" = "no pools available" ]
then
echo -n 0 > /var/db/zpool.status
else
if [ `cat /var/db/zpool.status` -eq 0 ]
then
zpool status | mail -s "ZPOOL NOT HEALTHY" $REPORT_EMAIL
echo -n 1 > /var/db/zpool.status
fi
fi