aboutsummaryrefslogtreecommitdiff
path: root/games/ldmud/files/ldmud.sh
diff options
context:
space:
mode:
Diffstat (limited to 'games/ldmud/files/ldmud.sh')
-rw-r--r--games/ldmud/files/ldmud.sh26
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