Deleted Added
full compact
404.status-zfs (220017) 404.status-zfs (231171)
1#!/bin/sh
2#
1#!/bin/sh
2#
3# $FreeBSD: head/etc/periodic/daily/404.status-zfs 220017 2011-03-26 01:24:55Z dougb $
3# $FreeBSD: head/etc/periodic/daily/404.status-zfs 231171 2012-02-08 00:08:21Z gjb $
4#
5
6# If there is a global system configuration file, suck it in.
7#
8if [ -r /etc/defaults/periodic.conf ]
9then
10 . /etc/defaults/periodic.conf
11 source_periodic_confs
12fi
13
14case "$daily_status_zfs_enable" in
15 [Yy][Ee][Ss])
16 echo
17 echo 'Checking status of zfs pools:'
18
4#
5
6# If there is a global system configuration file, suck it in.
7#
8if [ -r /etc/defaults/periodic.conf ]
9then
10 . /etc/defaults/periodic.conf
11 source_periodic_confs
12fi
13
14case "$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"
19 case "$daily_status_zfs_zpool_list_enable" in
20 [Yy][Ee][Ss])
21 lout=`zpool list`
22 echo "$lout"
23 echo
24 ;;
25 *)
26 ;;
27 esac
28 sout=`zpool status -x`
29 echo "$sout"
21 # zpool status -x always exits with 0, so we have to interpret its
22 # output to see what's going on.
30 # zpool status -x always exits with 0, so we have to interpret its
31 # output to see what's going on.
23 if [ "$out" = "all pools are healthy" \
24 -o "$out" = "no pools available" ]; then
32 if [ "$sout" = "all pools are healthy" \
33 -o "$sout" = "no pools available" ]; then
25 rc=0
26 else
27 rc=1
28 fi
29 ;;
30
31 *)
32 rc=0
33 ;;
34esac
35
36exit $rc
34 rc=0
35 else
36 rc=1
37 fi
38 ;;
39
40 *)
41 rc=0
42 ;;
43esac
44
45exit $rc