xref: /freebsd/usr.sbin/periodic/etc/daily/409.status-gconcat (revision 02e9120893770924227138ba49df1edb3896112a)
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_gconcat_enable" in
14    [Yy][Ee][Ss])
15	echo
16	echo 'Checking status of gconcat(8) devices:'
17
18	if gconcat status; then
19		components="$(gconcat 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