summaryrefslogtreecommitdiffstats
path: root/net-mgmt/snmptt/files/snmptt.sh.in
blob: 61860e7dbd18d2a4fe43477f3c282ee3e68487b2 (plain)
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
37
38
39
40
41
42
43
44
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: snmptt
# REQUIRE: LOGIN

#
# Add the following lines to /etc/rc.conf to enable snmptt:
#
# snmptt_enable="YES"
# snmptt_flags="<set as needed>"
#
# See snmptt documentation for flags.
#

. /etc/rc.subr

name=snmptt
rcvar=snmptt_enable

command=%%PREFIX%%/sbin/${name}
command_args=">/dev/null --daemon"
pidfile=/var/run/${name}.pid
# XXX: Makes assumptions about the interpreter path and version. However,
# USE_PERL5 should guarantee that this path is valid. In any event, we
# don't sed-ify the #! operators.
procname=/usr/bin/perl
required_files=%%PREFIX%%/etc/snmp/${name}.ini

# set defaults

snmptt_enable=${snmptt_enable:-"NO"}

stop_postcmd=stop_postcmd

stop_postcmd()
{
  rm -f $pidfile
}

load_rc_config ${name}
run_rc_command "$1"
OpenPOWER on IntegriCloud