2001-08-17 05:46:24 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2001-11-18 18:04:11 +00:00
|
|
|
# $Id$
|
2001-08-17 05:46:24 +00:00
|
|
|
#
|
2001-11-18 18:04:11 +00:00
|
|
|
# Crontab setup script for MBSE BBS
|
2001-08-17 05:46:24 +00:00
|
|
|
|
2001-11-18 18:04:11 +00:00
|
|
|
echo "MBSE BBS for Unix crontab setup. Checking your system..."
|
2001-08-17 05:46:24 +00:00
|
|
|
|
|
|
|
# Basic checks.
|
|
|
|
if [ `whoami` != "mbse" ]; then
|
|
|
|
cat << EOF
|
|
|
|
*** Run $0 as "mbse" user only! ***
|
|
|
|
|
|
|
|
Because the crontab for mbse must be changed, you must be mbse.
|
|
|
|
|
|
|
|
*** SETUP aborted ***
|
|
|
|
EOF
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$MBSE_ROOT" = "" ]; then
|
|
|
|
echo "*** The MBSE_ROOT variable doesn't exist ***"
|
|
|
|
echo "*** SETUP aborted ***"
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "`grep mbse: /etc/passwd`" = "" ]; then
|
|
|
|
echo "*** User 'mbse' does not exist on this system ***"
|
|
|
|
echo "*** SETUP aborted ***"
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "`crontab -l`" != "" ]; then
|
|
|
|
echo "*** User 'mbse' already has a crontab ***"
|
|
|
|
echo "*** SETUP aborted ***"
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
MHOME=$MBSE_ROOT
|
|
|
|
|
|
|
|
clear
|
|
|
|
cat << EOF
|
|
|
|
Everything looks allright to install the default crontab now.
|
|
|
|
If you didn't install all bbs programs yet, you better hit
|
|
|
|
Control-C now and run this script when everything is installed.
|
|
|
|
If you insist on installing the crontab without the bbs is complete
|
|
|
|
you might get a lot of mail from cron complaining about errors.
|
|
|
|
|
|
|
|
The default crontab will have entries for regular maintenance.
|
|
|
|
You need to add entries to start and stop polling fidonet uplinks.
|
|
|
|
There is a example at the bottom of the crontab which is commented
|
|
|
|
out of course.
|
|
|
|
|
|
|
|
On most systems you can edit the crontab by typing "crontab -e".
|
|
|
|
|
|
|
|
EOF
|
2003-01-12 16:13:48 +00:00
|
|
|
|
|
|
|
echo -n "Hit Return to continue or Control-C to abort: "
|
2001-08-17 05:46:24 +00:00
|
|
|
read junk
|
|
|
|
|
|
|
|
echo "Installing MBSE BBS crontab..."
|
|
|
|
|
|
|
|
crontab - << EOF
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Crontab for mbse bbs.
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# User maintenance etc. Just do it sometime when it's quiet.
|
|
|
|
00 09 * * * $MHOME/etc/maint
|
|
|
|
|
|
|
|
# Midnight event at 00:00.
|
|
|
|
00 00 * * * $MHOME/etc/midnight
|
|
|
|
|
2004-06-01 19:33:28 +00:00
|
|
|
# Weekly event at Sunday 00:15.
|
2002-02-09 23:17:49 +00:00
|
|
|
15 00 * * 0 $MHOME/etc/weekly
|
2001-08-17 05:46:24 +00:00
|
|
|
|
2005-08-26 10:42:43 +00:00
|
|
|
# Monthly event at the 1st day of the month at 01:30.
|
2002-02-09 23:17:49 +00:00
|
|
|
30 00 1 * * $MHOME/etc/monthly
|
2001-08-17 05:46:24 +00:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# From here you should enter your outgoing mailslots, when to send mail etc.
|
|
|
|
|
|
|
|
# Mail slot example.
|
|
|
|
#00 02 * * * export MBSE_ROOT=$MHOME; \$MBSE_ROOT/bin/mbout poll f16.n2801.z2 -quiet
|
|
|
|
#00 03 * * * export MBSE_ROOT=$MHOME; \$MBSE_ROOT/bin/mbout stop f16.n2801.z2 -quiet
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
echo "Done."
|
|
|
|
|