]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/periodic/etc/daily/410.status-mfi
Move all periodic related config and scripts to usr.sbin/periodic/
[FreeBSD/FreeBSD.git] / usr.sbin / periodic / etc / daily / 410.status-mfi
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_mfi_enable" in
15     [Yy][Ee][Ss])
16        echo
17        echo 'Checking status of mfi(4) devices:'
18
19        if mfiutil show volumes; then
20                if mfiutil show volumes | grep -q DEGRADED; then
21                        rc=3
22                else
23                        rc=0
24                fi
25        else
26                rc=2
27        fi
28        ;;
29
30     *)  rc=0;;
31 esac
32
33 exit $rc