Fixes and updates for FreeBSD

This commit is contained in:
Michiel Broek 2003-01-11 21:46:27 +00:00
parent 29e5616d74
commit 09c514c894
6 changed files with 87 additions and 11 deletions

View File

@ -48,6 +48,9 @@ v0.37.00 26-Dec-2002.
Prepared for more example translations.
Added German template files made by Joachim Kuwan.
script:
Added new init script for FreeBSD.
mbfile:
Move old files to another area failed, only the symbolic link
was moved.

View File

@ -29,7 +29,7 @@ log() {
#------------------------------------------------------------------------
#
cat << EOF
MBSE BBS for Linux first time setup. Checking your system..."
MBSE BBS for Unix, first time setup. Checking your system..."
If anything goes wrong with this script, look at the output of
the file SETUP.log that is created by this script in this
@ -282,8 +282,10 @@ if [ ! -d $MHOME/home ]; then
mkdir $MHOME/home
log "+" "[$?] Created directory $MHOME/home"
fi
chown mbse.bbs $MHOME/home
log "+" "[$?] chown mbse.bbs $MHOME/home"
chown mbse $MHOME/home
log "+" "[$?] chown mbse $MHOME/home"
chgrp bbs $MHOME/home
log "+" "[$?] chgrp bbs $MHOME/home"
chmod 770 $MHOME/home
log "+" "[$?] chmod 770 $MHOME/home"
if [ "$OSTYPE" = "Linux" ]; then
@ -307,9 +309,10 @@ if [ -d $MHOME/home/bbs ]; then
fi
mkdir -m 0770 $MHOME/home/bbs
log "+" "[$?] mkdir $MHOME/home/bbs"
chown mbse.bbs $MHOME/home/bbs
log "+" "[$?] chown mbse.bbs $MHOME/home/bbs"
chown mbse $MHOME/home/bbs
log "+" "[$?] chown mbse $MHOME/home/bbs"
chgrp bbs $MHOME/home/bbs
log "+" "[$?] chgrp bbs $MHOME/home/bbs"
echo ", removing password:"
if [ "$OSTYPE" = "Linux" ]; then

53
script/init.FreeBSD Normal file
View File

@ -0,0 +1,53 @@
#!/bin/sh
#
# description: Starts and stops MBSE BBS.
#
# $Id$
#
# /usr/local/etc/rc.d/mbse.sh
#
# Find the MBSE_ROOT from the /etc/passwd file.
MBSE_ROOT=`cat /etc/passwd | grep mbse: | awk -F ':' '{ print $6}'`
if [ "$MBSE_ROOT" = "" ]
then
echo "MBSE BBS: No 'mbse' user in the password file."
exit 1
fi
if [ ! -d $MBSE_ROOT ]
then
echo "MBSE BBS: Home directory '${MBSE_ROOT}' not found."
exit 1
fi
export MBSE_ROOT
# See how we were called.
case "$1" in
start)
rm -f ${MBSE_ROOT}/sema/*
rm -f ${MBSE_ROOT}/var/*.LCK
rm -f ${MBSE_ROOT}/tmp/mb*
su mbse -c '${MBSE_ROOT}/bin/mbtask' >/dev/null
echo -n " mbtask"
sleep 2
if [ -f ${MBSE_ROOT}/etc/config.data ]; then
su mbse -c '${MBSE_ROOT}/bin/mbstat open -quiet'
echo ", opened bbs"
fi
;;
stop)
if [ -f ${MBSE_ROOT}/etc/config.data ]; then
echo -n " logoff users"
su mbse -c '$MBSE_ROOT/bin/mbstat close wait -quiet' >/dev/null
fi
kill -15 `pidof ${MBSE_ROOT}/bin/mbtask`
echo -n " mbtask"
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
;;
esac
exit 0

View File

@ -316,12 +316,12 @@ fi
#--------------------------------------------------------------------------
#
# Adding scripts for FreeBSD and NetBSD
# Adding scripts for NetBSD
#
#
if [ "$DISTNAME" = "FreeBSD" ] || [ "$DISTNAME" = "NetBSD" ]; then
if [ "$DISTNAME" = "NetBSD" ]; then
#
# FreeBSD, NetBSD init
# NetBSD init
#
DISTINIT="$MBSE_ROOT/etc/rc"
echo "Adding $DISTNAME style MBSE BBS start/stop scripts"
@ -357,6 +357,23 @@ if [ "$DISTNAME" = "FreeBSD" ] || [ "$DISTNAME" = "NetBSD" ]; then
fi
#--------------------------------------------------------------------------
#
# Adding scripts for FreeBSD
#
#
if [ "$DISTNAME" = "FreeBSD" ]; then
#
# FreeBSD init
#
DISTINIT="/usr/local/etc/rc.d/mbse"
echo "Adding $DISTNAME style MBSE BBS start/stop script"
log "+" "Adding $DISTNAME style MBSE BBS start/stop script"
cp init.FreeBSD $DISTINIT
chmod 0755 $DISTINIT
fi
echo
echo "Please note, your MBSE BBS startup file is \"$DISTINIT\""

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $MBSE_ROOT/etc/rc: BBS Startup script for old Slackware, FreeBSD and NetBSD
# $MBSE_ROOT/etc/rc: BBS Startup script for old Slackware and NetBSD
#
# $Id$

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# /opt/mbse/etc/rc.shutdown: BBS Shutdown script for Slackware, FreeBSD and NetBSD.
# /opt/mbse/etc/rc.shutdown: BBS Shutdown script for Slackware and NetBSD.
#
# $Id$