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