diff options
author | Greg Lewis <glewis@FreeBSD.org> | 2003-09-05 22:26:41 +0000 |
---|---|---|
committer | Greg Lewis <glewis@FreeBSD.org> | 2003-09-05 22:26:41 +0000 |
commit | 87a76f2e41be39694c50a8789e0ead03be059c38 (patch) | |
tree | 975f085efb66bd88192a4d05239ad70a750c3f8a /games/ldmud/files | |
parent | 369f5b61b27f259ab38e822bb3ac77a0528a32b7 (diff) | |
download | ports-87a76f2e41be39694c50a8789e0ead03be059c38.tar.gz ports-87a76f2e41be39694c50a8789e0ead03be059c38.zip |
Notes
Diffstat (limited to 'games/ldmud/files')
-rw-r--r-- | games/ldmud/files/ldmud.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/games/ldmud/files/ldmud.sh b/games/ldmud/files/ldmud.sh new file mode 100644 index 000000000000..6584c31878fe --- /dev/null +++ b/games/ldmud/files/ldmud.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# $FreeBSD$ + +LDMUD_USER=mud +LDMUD=%%PREFIX%%/sbin/ldmud +LDMUD_LOG=%%LOGDIR%%/ldmud.log +LDMUD_PID=/var/run/ldmud.pid + +case "$1" in + start) + if [ -x "${LDMUD}" ]; then + su ${LDMUD_USER} -c "${LDMUD}" >> "${LDMUD_LOG}" 2>&1 & + echo $(($!+1)) > "${LDMUD_PID}" + echo -n ' ldmud' + fi + ;; + stop) + kill -TERM `cat "${LDMUD_PID}"` && rm -f "${LDMUD_PID}" + ;; + *) + echo "" + echo "Usage: `basename $0` { start | stop }" + echo "" + exit 64 + ;; +esac |