aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Scheidell <scheidell@FreeBSD.org>2012-01-12 20:34:38 +0000
committerMichael Scheidell <scheidell@FreeBSD.org>2012-01-12 20:34:38 +0000
commitdbd0d9d7099a8440f320ed150052e1c99e40a928 (patch)
tree2c34240b2f179aab837dfde4f2c162968b30f354
parent2788eda280232a873db733f475f4e7657b7b20c7 (diff)
downloadports-dbd0d9d7099a8440f320ed150052e1c99e40a928.tar.gz
ports-dbd0d9d7099a8440f320ed150052e1c99e40a928.zip
Notes
-rw-r--r--games/minecraft-server/Makefile3
-rw-r--r--games/minecraft-server/files/minecraft.in6
-rw-r--r--games/minecraft-server/files/pkg-deinstall.in5
-rw-r--r--games/minecraft-server/files/pkg-message.in2
4 files changed, 9 insertions, 7 deletions
diff --git a/games/minecraft-server/Makefile b/games/minecraft-server/Makefile
index 6ffc60ff146f..e2b891bb9c1f 100644
--- a/games/minecraft-server/Makefile
+++ b/games/minecraft-server/Makefile
@@ -35,6 +35,9 @@ USE_RC_SUBR= minecraft
SUB_FILES= pkg-deinstall \
pkg-message
+PLIST_SUB+= USERS=${USERS} \
+ GROUPS=${GROUPS}
+
.if !defined(WITHOUT_X11)
DESKTOP_ENTRIES="Minecraft-Server" "Block building game (server)" "${DATADIR}/Bookshelf.png" "minecraft-server" "Application;Game;" false
.endif
diff --git a/games/minecraft-server/files/minecraft.in b/games/minecraft-server/files/minecraft.in
index 32897a981262..1108a8db0a5b 100644
--- a/games/minecraft-server/files/minecraft.in
+++ b/games/minecraft-server/files/minecraft.in
@@ -27,7 +27,7 @@ if [ -e %%DATADIR%%/server.log.lck ]; then
else
echo "Starting Minecraft-Server..."
cd %%DATADIR%%
- /usr/bin/su %%MC_USER%% -c "%%PREFIX%%/bin/tmux new-session -d -s minecraft \"java -Xmx1024M -Xms1024M -jar %%DATADIR%%/minecraft_server.jar nogui\""
+ /usr/bin/su %%USERS%% -c "%%PREFIX%%/bin/tmux new-session -d -s minecraft \"java -Xmx1024M -Xms1024M -jar %%DATADIR%%/minecraft_server.jar nogui\""
i=0
while [ $i -lt 15 ]; do
@@ -42,7 +42,7 @@ else
if [ $i -ge 10 ]; then
echo "ERROR: Server could not be startet."
- /usr/bin/su mcserver -c "%%PREFIX%%/bin/tmux kill-session -t minecraft"
+ /usr/bin/su %%USERS%% -c "%%PREFIX%%/bin/tmux kill-session -t minecraft"
fi
fi
}
@@ -50,7 +50,7 @@ fi
minecraft_stop(){
if [ -e %%DATADIR%%/server.log.lck ]; then
echo "Halting Minecraft-Server."
- /usr/bin/su mcserver -c "%%PREFIX%%/bin/tmux send -t minecraft:0.0 stop \"Enter\""
+ /usr/bin/su %%USERS%% -c "%%PREFIX%%/bin/tmux send -t minecraft:0.0 stop \"Enter\""
i=0
diff --git a/games/minecraft-server/files/pkg-deinstall.in b/games/minecraft-server/files/pkg-deinstall.in
index 24ab45a267a1..77deb0e6e0cb 100644
--- a/games/minecraft-server/files/pkg-deinstall.in
+++ b/games/minecraft-server/files/pkg-deinstall.in
@@ -16,10 +16,9 @@ if [ -d %%ETCDIR%% ]; then
echo "Use 'rm -rf %%ETCDIR%%' to delete them."
echo
fi
-USER=%%MC_USER%%
-if pw usershow "${USER}" 2>/dev/null 1>&2; then
- echo "To delete ${USER} user permanently, use 'rmuser ${USER}'"
+if pw usershow "%%USERS%%" 2>/dev/null 1>&2; then
+ echo "To delete %%USERS%% user permanently, use 'rmuser %%USERS%%'"
fi
exit 0
diff --git a/games/minecraft-server/files/pkg-message.in b/games/minecraft-server/files/pkg-message.in
index b7a4f7507a0d..dc88ee729e2f 100644
--- a/games/minecraft-server/files/pkg-message.in
+++ b/games/minecraft-server/files/pkg-message.in
@@ -1,6 +1,6 @@
**************************************************
Daemon:
- The user mcserver has been added to your system.
+ The user %%USERS%% has been added to your system.
To run the server automativally with the system
add the following line to your /etc/rc.conf: