summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2003-07-11 15:08:57 +0000
committerMike Frysinger <vapier@gentoo.org>2003-07-11 15:08:57 +0000
commitcbe39b36fd59548fe43a9a8b852969b3b8cf4459 (patch)
treee7803747802bf9117e2d138b92de3522d15103ed /net-misc/lambdamoo/files/lambdamoo.rc
parentFixed typo (diff)
downloadgentoo-2-cbe39b36fd59548fe43a9a8b852969b3b8cf4459.tar.gz
gentoo-2-cbe39b36fd59548fe43a9a8b852969b3b8cf4459.tar.bz2
gentoo-2-cbe39b36fd59548fe43a9a8b852969b3b8cf4459.zip
initial ebuild #14312
Diffstat (limited to 'net-misc/lambdamoo/files/lambdamoo.rc')
-rw-r--r--net-misc/lambdamoo/files/lambdamoo.rc48
1 files changed, 48 insertions, 0 deletions
diff --git a/net-misc/lambdamoo/files/lambdamoo.rc b/net-misc/lambdamoo/files/lambdamoo.rc
new file mode 100644
index 000000000000..3b0009841895
--- /dev/null
+++ b/net-misc/lambdamoo/files/lambdamoo.rc
@@ -0,0 +1,48 @@
+#!/sbin/runscript
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/lambdamoo/files/lambdamoo.rc,v 1.1 2003/07/11 15:08:36 vapier Exp $
+
+# adapted from Pavel Curtis' restart.sh
+
+depend() {
+ need net
+}
+
+check_setup() {
+ if [ ! -r ${DB_PREFIX}.db ] ; then
+ eerror "Unable to read ${DB_PREFIX}.db"
+ return 1
+ fi
+
+ if [ -r ${DB_PREFIX}.db.new ] ; then
+ mv ${DB_PREFIX}.db ${DB_PREFIX}.db.old
+ mv ${DB_PREFIX}.db.new ${DB_PREFIX}.db
+ #Pavel compressed the old db here, I have not to save start time.
+ fi
+
+ if [ -f /var/log/lambdamoo.log ] ; then
+ cat /var/log/lambdamoo.log >> /var/log/lambdamoo.log.old
+ rm /var/log/lambdamoo.log
+ fi
+
+ return 0
+}
+
+start() {
+ check_setup || return 1
+
+ ebegin "Starting LambdaMOO"
+ echo "`date`: RESTARTED" >> ${DB_PREFIX}.log
+ start-stop-daemon --start --startas /usr/sbin/moo \
+ --pidfile /var/run/LambdaMOO.pid --make-pidfile \
+ -- -l /var/log/lambdamoo.log ${DB_PREFIX}.db ${DB_PREFIX}.db.new ${PORT} &
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping LambdaMOO"
+ start-stop-daemon -o --quiet --stop --pidfile /var/run/LambdaMOO.pid
+ eend $?
+ [ -f /var/run/LambdaMOO.pid ] && rm /var/run/LambdaMOO.pid
+}