diff options
Diffstat (limited to 'games/utserver')
-rw-r--r-- | games/utserver/Makefile | 2 | ||||
-rw-r--r-- | games/utserver/files/ucc.in | 46 |
2 files changed, 48 insertions, 0 deletions
diff --git a/games/utserver/Makefile b/games/utserver/Makefile index 36b4e261b3a6..a74cdf2b3a24 100644 --- a/games/utserver/Makefile +++ b/games/utserver/Makefile @@ -7,6 +7,7 @@ PORTNAME= utserver PORTVERSION= 451 +PORTREVISION= 1 CATEGORIES= games linux MASTER_SITES= http://public.planetmirror.com/pub/lokigames/installers/ut/:p436 \ http://fileserver.talkware.net/ut/:p436 \ @@ -27,6 +28,7 @@ USE_PERL5= yes NO_CDROM= Size; the data set is much too big NO_BUILD= yes WRKSRC= ${WRKDIR}/ut-server +USE_RC_SUBR= ucc UTDIR= ut-server PLIST_SUB= UTDIR="${UTDIR}/" diff --git a/games/utserver/files/ucc.in b/games/utserver/files/ucc.in new file mode 100644 index 000000000000..9cd054abef23 --- /dev/null +++ b/games/utserver/files/ucc.in @@ -0,0 +1,46 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: ucc +# REQUIRE: DAEMON +# +# Add the following line to /etc/rc.conf[.local] to enable ucc +# +# ucc_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable ucc. + +. %%RC_SUBR%% + +name="ucc" +rcvar=${name}_enable + +load_rc_config $name + +: ${ucc_enable="NO"} +: ${ucc_config="server.ini"} +: ${ucc_logfile="/dev/null"} +: ${ucc_map="dm-Hyperblast"} +: ${ucc_pidfile="/var/run/ucc.pid"} + +pidfile=${ucc_pidfile} +command="%%UTDIR%%/System/ucc-bin" +command_args="server ${ucc_map} ini=${ucc_config}" +start_cmd="ucc_startcmd" + +ucc_startcmd() +{ + if [ -z "$rc_fast" -a -n "$rc_pid" ]; then + echo "${name} already running? (pid=$rc_pid)." + return 1 + fi + echo Starting ${name}. + if ! kldstat -v | grep -E 'linux(aout|elf)' > /dev/null; then + err 1 "Linux support required" + return + fi + cd %%UTDIR%%/System/ + /usr/sbin/daemon -p ${ucc_pidfile} ${command} ${command_args} 2>&1 >> ${ucc_logfile} +} + +run_rc_command "$1" |