From 519418aca2539aed09b0f921b72dff622de82c39 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Tue, 28 Dec 2004 15:52:48 +0000 Subject: [PATCH] Added OpenBSD startup --- script/init.OpenBSD | 35 +++++++++++++++++++++++++++++++++++ script/installinit.sh | 21 +++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 script/init.OpenBSD diff --git a/script/init.OpenBSD b/script/init.OpenBSD new file mode 100644 index 00000000..6c4ed6d4 --- /dev/null +++ b/script/init.OpenBSD @@ -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 + diff --git a/script/installinit.sh b/script/installinit.sh index 54f472bb..88d7ecb0 100644 --- a/script/installinit.sh +++ b/script/installinit.sh @@ -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\""