freebsd-dev/etc/periodic/daily/420.status-network
John Baldwin d2077b4e57 Allow additional flags to be passed to netstat -i in the daily status check.
In particular, this allows an administrator to specify "-h" for human
readable output if that is preferred.

The default setting passes "-d", so that can be excluded by using a custom
setting.

Differential Revision:	https://reviews.freebsd.org/D2034
Submitted by:	Lystopad Aleksandr <laa@laa.zp.ua>
		(patch to add option for -h)
Reviewed by:	bz
MFC after:	1 week
2015-03-27 00:37:41 +00:00

32 lines
518 B
Bash
Executable File

#!/bin/sh
#
# $FreeBSD$
#
# If there is a global system configuration file, suck it in.
#
if [ -r /etc/defaults/periodic.conf ]
then
. /etc/defaults/periodic.conf
source_periodic_confs
fi
case "$daily_status_network_enable" in
[Yy][Ee][Ss])
echo ""
echo "Network interface status:"
flags="${daily_status_network_netstat_flags}"
case "$daily_status_network_usedns" in
[Yy][Ee][Ss])
;;
*)
flags="${flags} -n";;
esac
netstat -i ${flags} && rc=0 || rc=3;;
*) rc=0;;
esac
exit $rc