summaryrefslogtreecommitdiff
path: root/net-mgmt/net-snmp/files/snmpd.sh.sample
blob: a626c9b9e26e52c82c091f78b4714d039a5ef662 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
#
# $FreeBSD$

if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
    echo "$0: Cannot determine the PREFIX" >&2
    exit 1
fi

if [ -z "${source_rc_confs_defined}" ]; then
	if [ -r /etc/defaults/rc.conf ]; then
		. /etc/defaults/rc.conf
		source_rc_confs
	elif [ -r /etc/rc.conf ]; then
		. /etc/rc.conf
	fi
fi

case "$1" in
start)
	case "${net_snmpd_enable}" in
	    [Yy][Ee][Ss])
	    echo -n ' snmpd'
	    ${net_snmpd_program:-${PREFIX}/sbin/snmpd} ${net_snmpd_flags}
	    ;;
	esac
	;;
stop)
	killall snmpd && echo -n ' snmpd'
	;;
*)
	echo "Usage: `basename $0` {start|stop}" >&2
	;;
esac

exit 0