xref: /freebsd/usr.sbin/periodic/etc/daily/407.status-graid3 (revision fd45b686f9d92f583366c75b22c04c7ee49709c0)
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_graid3_enable" in
14    [Yy][Ee][Ss])
15	echo
16	echo 'Checking status of graid3(8) devices:'
17
18	if graid3 status; then
19		components="$(graid3 status -s | fgrep -v COMPLETE)"
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