aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/xymon-server/files/xymon-server.in
blob: d4748bddfe57f6184a58ca569e3593062fc529ec (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
37
38
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: xymon_server
# REQUIRE: DAEMON
# KEYWORD: shutdown

. /etc/rc.subr

name=xymon_server
rcvar=xymon_server_enable

load_rc_config "$name"
: ${xymon_server_enable:=NO}
: ${xymon_server_user:=%%XYMONUSER%%}

command="%%WWWDIR%%/server/xymon.sh"
command_args=start
start_precmd=xymon_prestart
pidfile=/var/log/xymon/xymonlaunch.pid
procname="%%WWWDIR%%/server/bin/xymonlaunch"

xymon_prestart()
{
	if [ ! -d /var/log/xymon ]; then
		install -d -o xymon /var/log/xymon
	fi

	for i in critical.cfg critical.cfg.bak ; do
		if [ ! -f ${i} ]; then
			install -o xymon -g xymon /dev/null %%WWWDIR%%/server/etc/${i} ;
		fi
	done
}

run_rc_command "$1"