blob: d219a68dc1bc1005f1f12234881de3c11b01f9a7 (
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
|
#!/bin/sh
# $FreeBSD$
#
# PROVIDE: teamspeak
# REQUIRE: LOGIN %%MYSQL%%
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# teamspeak_enable (bool): Set to NO by default.
# Set it to YES to enable teamspeak server.
#
. /etc/rc.subr
name="teamspeak"
rcvar=teamspeak_enable
load_rc_config $name
: ${teamspeak_enable:="NO"}
: ${teamspeak_pidfile:="%%DBDIR%%/teamspeak_server.pid"}
: ${teamspeak_db_dir:="%%DBDIR%%"}
: ${teamspeak_log_dir:="%%LOGDIR%%"}
# Add flags var so it isn't called in daemon
flags=" "
procname=%%PREFIX%%/libexec/ts3server
command=/usr/sbin/daemon
command_args="-fp "$teamspeak_pidfile" -u teamspeak %%PREFIX%%/libexec/ts3server dbsqlpath=%%PREFIX%%/share/teamspeak/server/sql/ inifile=%%PREFIX%%/etc/teamspeak/ts3server.ini licensepath=%%PREFIX%%/etc/teamspeak/ logpath="$teamspeak_log_dir" license_accepted=1 $teamspeak_flags"
teamspeak_chdir="$teamspeak_db_dir"
required_dirs="$teamspeak_db_dir $teamspeak_log_dir"
LD_LIBRARY_PATH=%%PREFIX%%/lib/teamspeak/server:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
run_rc_command "$1"
|