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

41 lines
852 B
Plaintext
Raw Normal View History

2001-08-17 05:46:24 +00:00
#
# BBS Shutdown script, should be run as BBS owner.
2003-01-12 16:13:48 +00:00
# Note: this is only used on old Slackware and NetBSD systems.
2002-02-04 15:18:06 +00:00
#
2002-05-18 12:00:11 +00:00
# On FreeBSD it needs the psmisc package.
#
2002-02-04 15:18:06 +00:00
# $Id$
2001-08-17 05:46:24 +00:00
#
2002-05-18 12:00:11 +00:00
export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:$MBSE_ROOT/bin:"
2001-08-17 05:46:24 +00:00
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
#