1168412Spjd#!/bin/sh 2168412Spjd# 3168412Spjd# $FreeBSD$ 4168412Spjd# 5168412Spjd 6168412Spjd# If there is a global system configuration file, suck it in. 7168412Spjd# 8168412Spjdif [ -r /etc/defaults/periodic.conf ] 9168412Spjdthen 10168412Spjd . /etc/defaults/periodic.conf 11168412Spjd source_periodic_confs 12168412Spjdfi 13168412Spjd 14168412Spjdcase "$daily_status_zfs_enable" in 15168412Spjd [Yy][Ee][Ss]) 16168412Spjd echo 17168412Spjd echo 'Checking status of zfs pools:' 18168412Spjd 19231171Sgjb case "$daily_status_zfs_zpool_list_enable" in 20231171Sgjb [Yy][Ee][Ss]) 21231171Sgjb lout=`zpool list` 22231171Sgjb echo "$lout" 23231171Sgjb echo 24231171Sgjb ;; 25231171Sgjb *) 26231171Sgjb ;; 27231171Sgjb esac 28231171Sgjb sout=`zpool status -x` 29231171Sgjb echo "$sout" 30168412Spjd # zpool status -x always exits with 0, so we have to interpret its 31168412Spjd # output to see what's going on. 32231171Sgjb if [ "$sout" = "all pools are healthy" \ 33231171Sgjb -o "$sout" = "no pools available" ]; then 34168412Spjd rc=0 35168412Spjd else 36168412Spjd rc=1 37168412Spjd fi 38168412Spjd ;; 39168412Spjd 40168412Spjd *) 41168412Spjd rc=0 42168412Spjd ;; 43168412Spjdesac 44168412Spjd 45168412Spjdexit $rc 46