mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-13 03:03:15 +00:00
87a8145c93
See pkg-message for details. * Use /etc/rc.conf variables to control snmpd invocation. * Add some make variables to set default values. Requested by: many people :-)
37 lines
628 B
Bash
37 lines
628 B
Bash
#!/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
|