xref: /freebsd/usr.sbin/periodic/etc/daily/401.status-graid (revision 734e82fe33aa764367791a7d603b383996c6b40b)
1#!/bin/sh
2#
3#
4
5# If there is a global system configuration file, suck it in.
6#
7if [ -r /etc/defaults/periodic.conf ]
8then
9    . /etc/defaults/periodic.conf
10    source_periodic_confs
11fi
12
13case "$daily_status_graid_enable" in
14    [Yy][Ee][Ss])
15	echo
16	echo 'Checking status of graid(8) devices:'
17
18	if graid status; then
19		components="$(graid status -s | fgrep -v OPTIMAL)"
20		if [ "${components}" ]; then
21			rc=3
22		else
23			rc=0
24		fi
25	else
26		rc=2
27	fi
28	;;
29
30    *)  rc=0;;
31esac
32
33exit $rc
34