- Minor changes to plist_sub and files

Submitted by:	scheidell
Approved by:	maintainer, gabor (mentor, implicit)
This commit is contained in:
Michael Scheidell
2012-01-12 20:34:38 +00:00
parent 2788eda280
commit dbd0d9d709
4 changed files with 9 additions and 7 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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: