Created
September 17, 2010 15:31
-
-
Save ekarulf/584396 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# PROVIDE: minecraft | |
# REQUIRE: DAEMON | |
# | |
# Add the following lines to /etc/rc.conf to run minecraft: | |
# | |
# minecraft_enable (bool): Set it to "YES" to enable minecraft. | |
# Default is "NO". | |
# minecraft_java_flags (flags): Set flags here. More options in java(1) | |
# Default is "-Xmx2048M -Xms2048M". | |
# minecraft_chdir (path): Set minecraft path here. | |
# Default is "/usr/local/minecraft". | |
# minecraft_user (user): Set user to run minecraft. | |
# Default is "nobody". | |
# | |
. /etc/rc.subr | |
name="minecraft" | |
rcvar=${name}_enable | |
pidfile="/var/run/minecraft.pid" | |
procname="/usr/local/jdk1.6.0/bin/java" | |
load_rc_config ${name} | |
: ${minecraft_enable="NO"} | |
: ${minecraft_user="nobody"} | |
: ${minecraft_chdir="/usr/local/minecraft"} | |
: ${minecraft_java_flags="-Xmx2048M -Xms2048M"} | |
command=/usr/sbin/daemon | |
command_args="-fp ${pidfile} /usr/local/bin/java ${minecraft_java_flags} -jar minecraft_server.jar" | |
run_rc_command "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rc script for FreeBSD (and probably Net and Open) to run minecraft server. Still needs some cleanup wrt procname and java variables