xref: /freebsd/usr.sbin/periodic/etc/daily/430.status-uptime (revision a64729f5077d77e13b9497cb33ecb3c82e606ee8)
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_uptime_enable" in
14    [Yy][Ee][Ss])
15	rwho=$(echo /var/rwho/*)
16        if [ -f "${rwho%% *}" ]
17        then
18	    echo ""
19	    echo "Local network system status:"
20	    prog=ruptime
21	else
22	    echo ""
23	    echo "Local system status:"
24	    prog=uptime
25	fi
26	rc=$($prog | tee /dev/stderr | wc -l)
27	if [ $? -eq 0 ]
28	then
29	    [ $rc -gt 1 ] && rc=1
30	else
31	    rc=3
32	fi;;
33
34    *)  rc=0;;
35esac
36
37exit $rc
38