]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - etc/periodic/daily/407.status-graid3
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / etc / periodic / daily / 407.status-graid3
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_graid3_enable" in
15     [Yy][Ee][Ss])
16         echo
17         echo 'Checking status of graid3(8) devices:'
18
19         if graid3 status; then
20                 components="$(graid3 status -s | fgrep -v COMPLETE)"
21                 if [ "${components}" ]; then
22                         rc=3
23                 else
24                         rc=0
25                 fi
26         else
27                 rc=2
28         fi
29         ;;
30
31     *)  rc=0;;
32 esac
33
34 exit $rc