This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
deb-mbse/script/mbse.stop
2003-01-12 16:13:48 +00:00

41 lines
852 B
Plaintext

#
# BBS Shutdown script, should be run as BBS owner.
# Note: this is only used on old Slackware and NetBSD systems.
#
# On FreeBSD it needs the psmisc package.
#
# $Id$
#
export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:$MBSE_ROOT/bin:"
if [ "$MBSE_ROOT" = "" ]; then
export MBSE_ROOT=`cat /etc/passwd | grep mbse: | awk -F ':' '{ print $6}'`
fi
if [ -f $MBSE_ROOT/bin/mbtask ]; then
echo -n "Shutdown MBSE BBS: "
if [ -f $MBSE_ROOT/etc/config.data ]; then
echo -n "closing the bbs "
cd $MBSE_ROOT
$MBSE_ROOT/bin/mbstat close wait -quiet
echo -n "done, "
fi
# Now kill the daemons
echo -n "kill "
base=`basename mbtask`
pid=`pidof $base`
echo -n "mbtask "
if ps h $pid >/dev/null 2>&1; then
kill $pid
RC=$?
[ $RC -eq 0 ] && echo -n "ok " || echo -n "failed "
fi
echo ""
else
echo "mbtask not available!"
fi
#