Added OpenBSD startup

This commit is contained in:
Michiel Broek 2004-12-28 15:52:48 +00:00
parent 2cec96dca1
commit 519418aca2
2 changed files with 56 additions and 0 deletions

35
script/init.OpenBSD Normal file
View File

@ -0,0 +1,35 @@
#:MBSE-BBS: bbs startup
#
# $Id$
#
# Added to /etc/rc.local by mbse bbs install
#
echo -n "Starting mbsebbs:"
# 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 " no 'mbse' user in the password file."
else
if [ ! -d ${MBSE_ROOT} ]
then
echo " home directory '${MBSE_ROOT}' not found."
else
export MBSE_ROOT
rm -f ${MBSE_ROOT}/var/run/*
rm -f ${MBSE_ROOT}/var/sema/*
rm -f ${MBSE_ROOT}/var/*.LCK
rm -f ${MBSE_ROOT}/tmp/mb*
su mbse -c '${MBSE_ROOT}/bin/mbtask' >/dev/null 2>&1
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
fi
fi

View File

@ -106,6 +106,10 @@ if [ "$OSTYPE" = "NetBSD" ]; then
DISTNAME="NetBSD"
DISTVERS=`uname -r`
fi
if [ "$OSTYPE" = "OpenBSD" ]; then
DISTNAME="OpenBSD"
DISTVERS=`uname -r`
fi
log "+" "Distribution $OSTYPE $DISTNAME $DISTVERS"
@ -314,6 +318,23 @@ if [ "$DISTNAME" = "FreeBSD" ]; then
fi
#--------------------------------------------------------------------------
#
# Adding startup commands for OpenBSD
#
#
if [ "$DISTNAME" = "OpenBSD" ]; then
if [ "`grep MBSE-BBS /etc/rc.local`" = "" ]; then
#
# OpenBSD init
#
DISTINIT="/etc/rc.local"
echo "Adding MBSE BBS startup commands to $DISTINIT"
log "+" "Adding MBSE BBS startup commands to $DISTINIT"
cat init.OpenBSD >> $DISTINIT
fi
fi
echo
echo "Please note, your MBSE BBS startup file is \"$DISTINIT\""