]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - etc/periodic/daily/430.status-rwho
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / etc / periodic / daily / 430.status-rwho
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # If there is a global system configuration file, suck it in.
7 #
8 if [ -r /etc/defaults/periodic.conf ]
9 then
10     . /etc/defaults/periodic.conf
11     source_periodic_confs
12 fi
13
14 case "$daily_status_rwho_enable" in
15     [Yy][Ee][Ss])
16         rwho=$(echo /var/rwho/*)
17         if [ -f "${rwho%% *}" ]
18         then
19             echo ""
20             echo "Local network system status:"
21             prog=ruptime
22         else
23             echo ""
24             echo "Local system status:"
25             prog=uptime
26         fi
27         rc=$($prog | tee /dev/stderr | wc -l)
28         if [ $? -eq 0 ]
29         then
30             [ $rc -gt 1 ] && rc=1
31         else
32             rc=3
33         fi;;
34
35     *)  rc=0;;
36 esac
37
38 exit $rc