summaryrefslogtreecommitdiff
path: root/sysutils/munin-node/files/munin-node.sh
blob: a95e7334da49078647833820ae28200eb1d68cc3 (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
#! /bin/sh
#
# $NetBSD: munin-node.sh,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
#
# PROVIDE: munin-node
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# You will need to set some variables in /etc/rc.conf to start munin-node:
#
# munin_node=YES
#

if [ -f /etc/rc.subr ]
then
    . /etc/rc.subr
fi

name="munin_node"
rcvar=$name
command=@PREFIX@/sbin/munin-node
command_interpreter=@PERL@
required_files=@PKG_SYSCONFDIR@/munin/munin-node.conf

if [ ! -d @STATEDIR@ ]; then
	mkdir @STATEDIR@
	chown munin:munin /var/run/munin
fi

if [ -f /etc/rc.subr ]; then
	load_rc_config $name
	run_rc_command "$1"
else
	echo -n " ${name}"
	exec ${command} ${command_args}
fi