--- /dev/null
+# ChangeLog for games-server/fbmuck
+# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
+# $Header: /home/cvsroot/gentoo-x86/games-server/fbmuck/ChangeLog,v 1.0 2004/02/03 15:50:00 jwind Exp $
+
+*fbmuck-6.11 (18 Apr 2011)
+
+ 18 Apr 2011; Justin Wind <jwind-gentoo@squeep.com> fbmuck-6.11.ebuild:
+ Version update.
+
--- /dev/null
+AUX fbmuck 496 RMD160 bccac32ea8a5be9e2a6d72cd474157b1cd2fb7c4 SHA1 8541ec7530cb141f0ef67059057aa270554743d9 SHA256 363fa4d9fa9a19b8e6d2fce686a458ac724255a772c24669ab5e5794606a8fc6
+AUX fbmuck-6.01-gentoo.patch 3236 RMD160 4c5833c08886985df00957ae5ae1728a80154eb2 SHA1 2865ac35f48f4516ccea8e98b14834a4adc59fbc SHA256 fb24ea863d450369a8b0685245f86d9b59f5eaace06a09b518c1be5d85bc9f44
+AUX fbmuck-6.05-gentoo.patch 1135 RMD160 938b2e629ed69d6180200eb20d9cc03b63e87a37 SHA1 f5d8aa9287b5b1a7750e4ae1bfed4b3787b61db2 SHA256 243dcc89c911bf775a42112b1a01d9d74d2a9b2181ad535d18917f28710b2aec
+AUX fbmuck-6.07-gentoo.patch 2330 RMD160 a7e9116da03f1ba3b446d63c617c5297e2eef8d4 SHA1 5b06f45db75b778889e290c6c2b2c547c58f78cf SHA256 73277a7b0596f172bce3ac2477942b747b8bf202567942684696fc34e59e0eaa
+AUX fbmuck-6.09-gentoo.patch 1157 RMD160 4f5ffe3bd4246babcca496a9f730c6fb249f8cb9 SHA1 910b35f16086b544eabdf929b10ec7f6cea67c4c SHA256 9e101561bf77bb3dded19aa5abc7ac593122693bead52a0ded8dffc0555a3bf4
+AUX fbmuckctl 5271 RMD160 66aec1fb7e813ba291f58839aae8c17f0c2f8a17 SHA1 8da83d0ed3f1c9e95c54c401c88775943d92bfbb SHA256 4821530e52768d4d94d3b1a4482d188fc9da1fecaf97ff5dfacd6029e8c67ee6
+AUX fbmucks 209 RMD160 7758ba6de902858745e435c0fdceb0e8b2f94473 SHA1 b1e8741dc4f79ceeff5a8f554d5858c61f115fb8 SHA256 0411aad95f4cc5c54876586690e7f3e44777aac46cb3b068c6cc2f0ebae111a2
+DIST fbmuck-6.09.tar.gz 1215430 RMD160 0e7244850ac4c6b4ee785ce749108a4ade588938 SHA1 a310d846749ce0697aafefbc1b3c9bd5a2b5d15f SHA256 dc132eb02b76897626253d7101152345ed2e7df52ad539125e66d00039587433
+DIST fbmuck-6.11.tar.gz 1954838 RMD160 6ed631362b1036ae59bcd9818e01f34c0caa64a3 SHA1 f906567617dba6cc81b424159fa915d59320a834 SHA256 dd72e4ae5feef186655baea7fa9c6ed5325ef2ba70fa91e40235bc99b4e37a9a
+EBUILD fbmuck-6.09.ebuild 1179 RMD160 65800a68808670f36c78df793e9b59fe4717e3f8 SHA1 dc99b36a2fce9b08224c6de9bab48d7ee7203afa SHA256 8f07f03377c91c0807257ddf41a795537171ae0b6dba40b10409e8ea90c0b9c3
+EBUILD fbmuck-6.11.ebuild 1171 RMD160 bc59e0661f1e1ec4a944eb95614cdf60bd027a86 SHA1 d0317b93f163f5f3e6a3032bedfc5904c14c642e SHA256 f3ba04bce23c689e536032b4fb12a3e4cdbe2445d06f74e664609e8cc18aedaa
+MISC ChangeLog 339 RMD160 c36f3767ae6ecfbffbc20c88f3ec6d3e1fd35c43 SHA1 7e7b32a8bde03a38dcec5277dcbee4dea48dcafb SHA256 5486d8e0a41c13eaa97c8117fe3007606ce9c72d37fe65b14c7e63cc77e973ec
--- /dev/null
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils fixheadtails
+
+IUSE="ssl ipv6 diskbase debug pcre"
+
+DESCRIPTION="A database-backed multi-user chat server."
+SRC_URI="mirror://sourceforge/fbmuck/${P}.tar.gz"
+HOMEPAGE="http://www.belfry.com/fuzzball/"
+
+SLOT="2"
+LICENSE="GPL-2"
+KEYWORDS="~x86 ~amd64 ~sparc"
+
+DEPEND=">=sys-apps/sed-4
+ ssl? ( dev-libs/openssl )"
+
+RDEPEND="ssl? ( dev-libs/openssl )
+ pcre? ( dev-libs/libpcre )"
+
+RESTRICT="nostrip"
+
+src_unpack() {
+ unpack ${A}
+ ht_fix_all
+ epatch ${FILESDIR}/${P}-gentoo.patch
+}
+
+src_compile() {
+ use diskbase && sed -i -e 's:#undef DISKBASE:#define DISKBASE:' include/config.h
+ econf \
+ `use_with ssl ssl=/usr` \
+ `use_with pcre pcre=/usr` \
+ `use_enable ipv6` \
+ `use_enable debug` \
+ || die "Could not configure"
+ emake || die "Could not make"
+}
+
+src_install() {
+ dodir /usr/bin
+ keepdir /usr/share/fbmuck
+
+ make DESTDIR=${D} install || die "Could not install"
+
+ exeinto /usr/bin
+ doexe ${FILESDIR}/fbmuckctl
+
+ exeinto /etc/init.d
+ doexe ${FILESDIR}/fbmuck
+
+ insinto /etc
+ doins ${FILESDIR}/fbmucks
+
+ dodoc CHANGESfb6 INSTALLATION README
+}
--- /dev/null
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils fixheadtails
+
+IUSE="ssl ipv6 diskbase debug pcre"
+
+DESCRIPTION="A database-backed multi-user chat server."
+SRC_URI="mirror://sourceforge/fbmuck/${P}.tar.gz"
+HOMEPAGE="http://www.belfry.com/fuzzball/"
+
+SLOT="2"
+LICENSE="GPL-2"
+KEYWORDS="x86 amd64"
+
+DEPEND=">=sys-apps/sed-4
+ ssl? ( dev-libs/openssl )"
+
+RDEPEND="ssl? ( dev-libs/openssl )
+ pcre? ( dev-libs/libpcre )"
+
+RESTRICT="nostrip"
+
+src_unpack() {
+ unpack ${A}
+ ht_fix_all
+# epatch ${FILESDIR}/${P}-gentoo.patch
+}
+
+src_compile() {
+ use diskbase && sed -i -e 's:#undef DISKBASE:#define DISKBASE:' include/config.h
+ econf \
+ `use_with ssl ssl=/usr` \
+ `use_with pcre pcre=/usr` \
+ `use_enable ipv6` \
+ `use_enable debug` \
+ || die "Could not configure"
+ emake || die "Could not make"
+}
+
+src_install() {
+ dodir /usr/bin
+ keepdir /usr/share/fbmuck
+
+ make DESTDIR=${D} install || die "Could not install"
+
+ exeinto /usr/bin
+ doexe ${FILESDIR}/fbmuckctl
+
+ exeinto /etc/init.d
+ doexe ${FILESDIR}/fbmuck
+
+ insinto /etc
+ doins ${FILESDIR}/fbmucks
+
+ dodoc CHANGESfb6 INSTALLATION README
+}
--- /dev/null
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils fixheadtails
+
+IUSE="ssl ipv6 diskbase debug pcre"
+
+DESCRIPTION="A database-backed multi-user chat server."
+SRC_URI="mirror://sourceforge/fbmuck/${P}.tar.gz"
+HOMEPAGE="http://www.belfry.com/fuzzball/"
+
+SLOT="2"
+LICENSE="GPL-2"
+KEYWORDS="x86 amd64"
+
+DEPEND=">=sys-apps/sed-4
+ ssl? ( dev-libs/openssl )"
+
+RDEPEND="ssl? ( dev-libs/openssl )
+ pcre? ( dev-libs/libpcre )"
+
+RESTRICT="nostrip"
+
+src_unpack() {
+ unpack ${A}
+ ht_fix_all
+# epatch ${FILESDIR}/${P}-gentoo.patch
+}
+
+src_compile() {
+ use diskbase && sed -i -e 's:#undef DISKBASE:#define DISKBASE:' include/config.h
+ econf \
+ `use_with ssl ssl=/usr` \
+ `use_with pcre pcre=/usr` \
+ `use_enable ipv6` \
+ `use_enable debug` \
+ || die "Could not configure"
+ emake || die "Could not make"
+}
+
+src_install() {
+ dodir /usr/bin
+ keepdir /usr/share/fbmuck
+
+ make DESTDIR=${D} install || die "Could not install"
+
+ exeinto /usr/bin
+ doexe ${FILESDIR}/fbmuckctl
+
+ exeinto /etc/init.d
+ doexe ${FILESDIR}/fbmuck
+
+ insinto /etc
+ doins ${FILESDIR}/fbmucks
+
+ dodoc CHANGESfb6 INSTALLATION README
+}
--- /dev/null
+#!/sbin/runscript
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ use dns
+}
+
+checkconfig() {
+ if [ ! -f /etc/fbmucks ] ; then
+ eerror "Please create /etc/fbmucks"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return $?
+
+ ebegin "Starting all fbmucks"
+ fbmuckctl start &
+ eend $? "Failed to start fbmucks"
+}
+
+stop() {
+ ebegin "Stopping fbmucks"
+ fbmuckctl stop &
+ eend $? "Failed to stop fbmucks"
+}
--- /dev/null
+diff -Bru fbmuck-6.01.orig/game/restart.in fbmuck-6.01/game/restart.in
+--- fbmuck-6.01.orig/game/restart.in 2003-09-11 12:33:35.000000000 -0700
++++ fbmuck-6.01/game/restart.in 2004-01-28 20:21:19.000000000 -0800
+@@ -109,7 +109,7 @@
+
+ PANICDB="${DBOUT}.PANIC"
+ if [ -r $PANICDB ]; then
+- end=`tail -1 $PANICDB`
++ end=`tail -n 1 $PANICDB`
+ if [ "x$end" = "x***END OF DUMP***" ]; then
+ mv $PANICDB $DBOUT
+ rm -f $DELTAS
+@@ -130,7 +130,7 @@
+ exit
+ fi
+
+-end=`tail -1 $DBIN`
++end=`tail -n 1 $DBIN`
+ if [ "x$end" != 'x***END OF DUMP***' ]; then
+ echo "WARNING\! The "$DBIN" file is incomplete and therefore corrupt\!"
+ echo "Restart attempt aborted."
+@@ -142,16 +142,16 @@
+
+ if [ -r $DELTAS ]; then
+ echo "Restoring from delta."
+- end=`tail -1 $DELTAS`
++ end=`tail -n 1 $DELTAS`
+ if [ "x$end" = "x***END OF DUMP***" ]; then
+ cat $DELTAS >> $DBIN
+ else
+ echo "Last delta is incomplete. Truncating to previous dump."
+- grep -n '^***END OF DUMP***' $DELTAS | tail -1 > .ftmp$$
++ grep -n '^***END OF DUMP***' $DELTAS | tail -n 1 > .ftmp$$
+ llinum=`cut -d: -f1 < .ftmp$$`
+ llcnt=`wc -l < .ftmp$$`
+ if [ $llcnt -gt 0 ]; then
+- head -$llinum $DELTAS >> $DBIN
++ head -n $llinum $DELTAS >> $DBIN
+ else
+ echo "Hmm. No previous delta dump."
+ fi
+@@ -161,7 +161,7 @@
+ fi
+
+ dbsiz=`ls -1s $DBIN | awk '{print $1}'`
+-diskfree=`df -k . | tail -1 | awk '{print $4}'`
++diskfree=`df -k . | tail -n 1 | awk '{print $4}'`
+
+ diskneeded=`expr $dbsiz \* 3`
+ spacediff=`expr $diskneeded - $diskfree`
+diff -Bru fbmuck-6.01.orig/src/Makefile.in fbmuck-6.01/src/Makefile.in
+--- fbmuck-6.01.orig/src/Makefile.in 2003-06-22 17:06:45.000000000 -0700
++++ fbmuck-6.01/src/Makefile.in 2004-02-03 14:59:24.291796462 -0800
+@@ -37,15 +37,15 @@
+ INCLUDE= ${ROOT}/include
+
+ # The root of the directory tree to install to.
+-prefix=@prefix@
++prefix=${D}@prefix@
+ exec_prefix=@exec_prefix@
+ # Destinations for binaries
+ INSTALL_BINDIR=@bindir@
+ INSTALL_SBINDIR=@sbindir@
+ # Destination for helpfiles
+-INSTALL_HELPDIR=@datadir@/fbmuck
++INSTALL_HELPDIR=${D}@datadir@/fbmuck
+ # Destination for starter databases
+-INSTALL_DBSDIR=@datadir@/fbmuck/starter_dbs
++INSTALL_DBSDIR=${D}@datadir@/fbmuck/starter_dbs
+
+ # ${DESTDIR} is used by the Debian packaging system to build the .debs
+ # and is defined by the debian/rules file.
+@@ -157,7 +157,7 @@
+
+ all: ${TARGETS}
+
+-fbmuck: ${P} ${COBJ} ${MALLOBJ} interface.o ${LOBJ} mkversion.sh Makefile
++fbmuck: ${COBJ} ${MALLOBJ} interface.o ${LOBJ} mkversion.sh Makefile
+ sh mkversion.sh
+ ${PRE} ${CC} ${CFLAGS} ${INCL} ${DEFS} -c version.c
+ if [ -e fbmuck ]; then ${MV} fbmuck fbmuck~ ; fi
+diff -Bru fbmuck-6.01.orig/src/random.c fbmuck-6.01/src/random.c
+--- fbmuck-6.01.orig/src/random.c 2003-06-22 16:55:45.000000000 -0700
++++ fbmuck-6.01/src/random.c 2004-01-28 15:37:29.000000000 -0800
+@@ -5,6 +5,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <stdint.h>
+
+ /*****************************************************************/
+
+@@ -25,8 +26,8 @@
+ * will fill a supplied 16-byte array with the digest.
+ */
+
+-typedef unsigned long word32;
+-typedef unsigned char byte;
++typedef uint32_t word32;
++typedef uint8_t byte;
+
+ struct xMD5Context {
+ word32 buf[4];
--- /dev/null
+diff -Bru fbmuck-6.05.orig/src/Makefile.in fbmuck-6.05/src/Makefile.in
+--- fbmuck-6.05.orig/src/Makefile.in 2003-06-22 17:06:45.000000000 -0700
++++ fbmuck-6.05/src/Makefile.in 2004-02-03 14:59:24.291796462 -0800
+@@ -37,15 +37,15 @@
+ INCLUDE= ${ROOT}/include
+
+ # The root of the directory tree to install to.
+-prefix=@prefix@
++prefix=${D}@prefix@
+ exec_prefix=@exec_prefix@
+ # Destinations for binaries
+ INSTALL_BINDIR=@bindir@
+ INSTALL_SBINDIR=@sbindir@
+ # Destination for helpfiles
+-INSTALL_HELPDIR=@datadir@/fbmuck
++INSTALL_HELPDIR=${D}@datadir@/fbmuck
+ # Destination for starter databases
+-INSTALL_DBSDIR=@datadir@/fbmuck/starter_dbs
++INSTALL_DBSDIR=${D}@datadir@/fbmuck/starter_dbs
+
+ # ${DESTDIR} is used by the Debian packaging system to build the .debs
+ # and is defined by the debian/rules file.
+@@ -162,7 +162,7 @@
+
+ all: ${TARGETS}
+
+-fbmuck: libpcre.a ${P} ${COBJ} ${MALLOBJ} interface.o ${LOBJ} mkversion.sh Makefile
++fbmuck: libpcre.a ${COBJ} ${MALLOBJ} interface.o ${LOBJ} mkversion.sh Makefile
+ sh mkversion.sh
+ ${PRE} ${CC} ${CFLAGS} ${INCL} ${DEFS} -c version.c
+ if [ -e fbmuck ]; then ${MV} fbmuck fbmuck~ ; fi
--- /dev/null
+diff -Bru fbmuck-6.07.orig/src/Makefile.in fbmuck-6.07/src/Makefile.in
+--- fbmuck-6.07.orig/src/Makefile.in 2005-08-28 17:32:59.000000000 -0700
++++ fbmuck-6.07/src/Makefile.in 2006-11-21 11:45:00.000000000 -0800
+@@ -37,15 +37,15 @@
+ INCLUDE= ${ROOT}/include
+
+ # The root of the directory tree to install to.
+-prefix=@prefix@
++prefix=${D}@prefix@
+ exec_prefix=@exec_prefix@
+ # Destinations for binaries
+ INSTALL_BINDIR=@bindir@
+ INSTALL_SBINDIR=@sbindir@
+ # Destination for helpfiles
+-INSTALL_HELPDIR=@datadir@/fbmuck
++INSTALL_HELPDIR=${D}@datadir@/fbmuck
+ # Destination for starter databases
+-INSTALL_DBSDIR=@datadir@/fbmuck/starter_dbs
++INSTALL_DBSDIR=${D}@datadir@/fbmuck/starter_dbs
+
+ # ${DESTDIR} is used by the Debian packaging system to build the .debs
+ # and is defined by the debian/rules file.
+@@ -168,7 +168,7 @@
+ @echo "#define BINDIR \"$(INSTALL_BINDIR)\"" >> $(INCLUDE)/defines.h
+ @echo "#define INSTALL_HELPDIR \"$(INSTALL_HELPDIR)\"" >> $(INCLUDE)/defines.h
+
+-fbmuck: $(INCLUDE)/defines.h libpcre.a ${P} ${COBJ} ${MALLOBJ} interface.o ${LOBJ} mkversion.sh Makefile
++fbmuck: $(INCLUDE)/defines.h libpcre.a ${COBJ} ${MALLOBJ} interface.o ${LOBJ} mkversion.sh Makefile
+ sh mkversion.sh
+ ${PRE} ${CC} ${CFLAGS} ${INCL} ${DEFS} -c version.c
+ if [ -f fbmuck ]; then ${MV} fbmuck fbmuck~ ; fi
+diff -Bru fbmuck-6.07.orig/src/mkversion.sh fbmuck-6.07/src/mkversion.sh
+--- fbmuck-6.07.orig/src/mkversion.sh 2005-07-06 21:32:32.000000000 -0700
++++ fbmuck-6.07/src/mkversion.sh 2006-11-21 11:44:08.000000000 -0800
+@@ -241,7 +241,6 @@
+ notify_nolisten(player, smatch_h_version, 1);
+ notify_nolisten(player, speech_h_version, 1);
+ notify_nolisten(player, tune_h_version, 1);
+- notify_nolisten(player, version_h_version, 1);
+ return;
+ }
+
+diff -Bru fbmuck-6.07.orig/src/predicates.c fbmuck-6.07/src/predicates.c
+--- fbmuck-6.07.orig/src/predicates.c 2006-11-26 18:04:52.000000000 -0800
++++ fbmuck-6.07/src/predicates.c 2006-11-26 17:57:28.000000000 -0800
+@@ -549,7 +549,7 @@
+ #else /* !GOD_PRIV */
+ /* We don't want someone setting themselves !W, to prevent
+ * a case where there are no wizards at all */
+- return ((Typeof(thing) == TYPE_PLAYER && thing == OWNER(player));
++ return ((Typeof(thing) == TYPE_PLAYER) && thing == OWNER(player));
+ #endif /* GOD_PRIV */
+ } else
+ return 1;
+
--- /dev/null
+diff -Bru fbmuck-6.05.orig/src/Makefile.in fbmuck-6.05/src/Makefile.in
+--- fbmuck-6.09.orig/src/Makefile.in 2003-06-22 17:06:45.000000000 -0700
++++ fbmuck-6.09/src/Makefile.in 2004-02-03 14:59:24.291796462 -0800
+@@ -37,15 +37,15 @@
+ INCLUDE= ${ROOT}/include
+
+ # The root of the directory tree to install to.
+-prefix=@prefix@
++prefix=${D}@prefix@
+ exec_prefix=@exec_prefix@
+ # Destinations for binaries
+ INSTALL_BINDIR=@bindir@
+ INSTALL_SBINDIR=@sbindir@
+ # Destination for helpfiles
+-INSTALL_HELPDIR=@datadir@/fbmuck
++INSTALL_HELPDIR=${D}@datadir@/fbmuck
+ # Destination for starter databases
+-INSTALL_DBSDIR=@datadir@/fbmuck/starter_dbs
++INSTALL_DBSDIR=${D}@datadir@/fbmuck/starter_dbs
+
+ # ${DESTDIR} is used by the Debian packaging system to build the .debs
+ # and is defined by the debian/rules file.
+@@ -162,7 +162,7 @@
+
+ all: ${TARGETS}
+
+-fbmuck: $(INCLUDE)/defines.h ${P} ${COBJ} ${MALLOBJ} interface.o ${LOBJ} mkversion.sh Makefile
++fbmuck: $(INCLUDE)/defines.h ${COBJ} ${MALLOBJ} interface.o ${LOBJ} mkversion.sh Makefile
+ sh mkversion.sh
+ ${PRE} ${CC} ${CFLAGS} ${INCL} ${DEFS} -c version.c
+ if [ -e fbmuck ]; then ${MV} fbmuck fbmuck~ ; fi
--- /dev/null
+#!/bin/bash
+# fbmuckctl This script takes care of starting and stopping
+# FuzzBall Muck servers on this machine.
+#
+# The format of /etc/fbmucks is:
+#
+# MUCKNAME USERNAME MUCK_ROOT_PATH SCRIPTNAME PORTS
+# tygmuck3 tygryss /home/revar/tygmuck restart 8888,8899s
+# feepmuck foxen /home/foxen/muck restart 8800
+#
+# Port numbers are separate by commas. An 's' at the end of a port number
+# means that that port is designated as a secure SSL port.
+
+[ -f /etc/fbmucks ] || exit 0
+
+RETVAL=0
+pidfile="netmuck.pid"
+who=`whoami`
+cmd=$1
+shift
+mucknames=$@
+
+# See how we were called.
+case "$cmd" in
+ start)
+ # Start mucks.
+ cat /etc/fbmucks | \
+ grep -v '^[ ]*#' |\
+ grep -v '^[ ]*$' |\
+ while read name user path script ports; do
+ if [ "x$mucknames" != "x" ]; then
+ found=0
+ for muckname in $mucknames; do
+ if [ "x$muckname" = "x$name" ]; then
+ found=1
+ fi
+ done
+ if [ $found -eq 0 ]; then
+ continue
+ fi
+ fi
+ if [ "x$who" = "xroot" -o "x$who" = "x$user" ]; then
+ ports=`echo $ports | sed 's/,/ /g' | sed 's/\([0-9]*\)s/-sport \1/g'`
+ rm -f $path/$pidfile
+ echo -n "Starting $name fbmuck: "
+ failed=0
+ if [ "x$who" = "x$user" ]; then
+ $path/$script $ports
+ if [ $? == 0 ]; then
+ echo "started $name fbmuck"
+ else
+ failed=1
+ echo "failed to start $name fbmuck"
+ fi
+ else
+ rcode=`su $user -c "$path/$script $ports; echo \\\$?"`
+ if [ "$rcode" == 0 ]; then
+ echo "started $name fbmuck"
+ else
+ failed=1
+ echo "failed to start $name fbmuck"
+ fi
+ fi
+ if [ $failed == 0 ]; then
+ while [ ! -f $path/$pidfile ]; do
+echo "DEBUG: waiting for $path/$pidfile to exist ..."
+ sleep 1
+ done
+ fi
+ echo ""
+ fi
+ done
+ ;;
+ stop)
+ # Stop mucks.
+ cat /etc/fbmucks | \
+ grep -v '^[ ]*#' |\
+ grep -v '^[ ]*$' |\
+ while read name user path script ports; do
+ if [ "x$mucknames" != "x" ]; then
+ found=0
+ for muckname in $mucknames; do
+ if [ "x$muckname" = "x$name" ]; then
+ found=1
+ fi
+ done
+ if [ $found = 0 ]; then
+ continue
+ fi
+ fi
+ if [ "x$who" = "xroot" -o "x$who" = "x$user" ]; then
+ didfail=1
+ echo -n "Shutting down $name fbmuck: "
+ if [ -f $path/$pidfile ]; then
+ pid=`cat $path/$pidfile`
+ if [ -d /proc/$pid ]; then
+ if kill $pid; then
+ didfail=0
+ else
+ didfail=1
+ fi
+ # Wait for server to complete a clean shutdown.
+ # If the process doesn't change status for a period
+ # longer than sixty seconds, assume it is hung, and exit.
+ laststat="S"
+ limitcnt=60
+ while [ -d /proc/$pid ]; do
+ newstat=`grep 'State:' /proc/$pid/status|awk '{print $2}'`
+ if [ "x$newstat" != "xR" -a "x$laststat" = "x$newstat" ]; then
+ limitcnt=`expr $limitcnt - 1`
+ if [ $limitcnt -eq 0 ]; then
+ didfail=1
+ break
+ fi
+ else
+ limitcnt=60
+ laststat=$newstat
+ fi
+ sleep 1
+ done
+ fi
+ rm -f $path/$pidfile
+ fi
+ [ $didfail = 0 ] \
+ && echo "stopped $name fbmuck" \
+ || echo "failed to stop $name fbmuck"
+ echo ""
+ fi
+ done
+ ;;
+ reload)
+ $0 stop
+ $0 start
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ status)
+ cat /etc/fbmucks | \
+ grep -v '^[ ]*#' |\
+ grep -v '^[ ]*$' |\
+ while read name user path script ports; do
+ if [ "x$mucknames" != "x" ]; then
+ found=0
+ for muckname in $mucknames; do
+ if [ "x$muckname" = "x$name" ]; then
+ found=1
+ fi
+ done
+ if [ $found -eq 0 ]; then
+ continue
+ fi
+ fi
+ if [ "x$who" = "xroot" -o "x$who" = "x$user" ]; then
+ echo -n "fbmuck for $name "
+ if [ -f $path/$pidfile ]; then
+ pid=`cat $path/$pidfile`
+ if [ -d /proc/$pid ]; then
+ echo "is running. ($pid)"
+ else
+ echo "is not running."
+ fi
+ else
+ echo "is not running."
+ fi
+ fi
+ done
+ ;;
+ *)
+ echo -n "Usage: $0 {start|stop|restart|status}"
+ if [ "x$who" = "xroot" ]; then
+ echo " [muckname,[muckname,[..]]]"
+ else
+ echo ""
+ fi
+ exit 1
+esac
+
+exit 0
+
--- /dev/null
+# sample config file, listing games to control automatically
+# MUCKNAME USERNAME MUCK_ROOT_PATH SCRIPTNAME PORTS
+#muckname user /home/user/muck restart 8888,8899s