]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - etc/periodic/daily/404.status-zfs
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / etc / periodic / daily / 404.status-zfs
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # If there is a global system configuration file, suck it in.
7 #
8 if [ -r /etc/defaults/periodic.conf ]
9 then
10     . /etc/defaults/periodic.conf
11     source_periodic_confs
12 fi
13
14 case "$daily_status_zfs_enable" in
15     [Yy][Ee][Ss])
16         echo
17         echo 'Checking status of zfs pools:'
18
19         out=`zpool status -x`
20         echo "$out"
21         # zpool status -x always exits with 0, so we have to interpret its
22         # output to see what's going on.
23         if [ "$out" = "all pools are healthy" \
24             -o "$out" = "no pools available" ]; then
25                 rc=0
26         else
27                 rc=1
28         fi
29         ;;
30
31     *)
32         rc=0
33         ;;
34 esac
35
36 exit $rc