From d1c532d1caf181558821b57633cb1334971f31a2 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Mon, 4 Feb 2002 15:18:06 +0000 Subject: [PATCH] Changed init scripts --- script/Makefile | 4 +- script/init.Debian | 64 ++++++++ script/init.RedHat | 105 ++++++++++++ script/init.Slackware | 69 ++++++++ script/init.SuSE | 68 ++++++++ script/installinit.sh | 364 ++++-------------------------------------- script/mbse.start | 6 +- script/mbse.stop | 6 +- script/midnight | 2 +- script/monthly | 2 +- script/rc | 4 +- script/rc.shutdown | 4 +- script/weekly | 2 +- 13 files changed, 352 insertions(+), 348 deletions(-) create mode 100644 script/init.Debian create mode 100644 script/init.RedHat create mode 100644 script/init.Slackware create mode 100644 script/init.SuSE diff --git a/script/Makefile b/script/Makefile index c23da512..bf437273 100644 --- a/script/Makefile +++ b/script/Makefile @@ -1,11 +1,11 @@ # Makefile for MBSE BBS under Linux -# Copyright (c) 1998, 2001 by M. Broek. # $Id$ include ../Makefile.global OTHER = Makefile README maint midnight weekly monthly installinit.sh rc rc.shutdown \ - mbse.start mbse.stop bbsdoor.sh rundoor.sh + mbse.start mbse.stop bbsdoor.sh rundoor.sh init.Debian init.RedHat \ + init.Slackware init.SuSE #################################################################################################### diff --git a/script/init.Debian b/script/init.Debian new file mode 100644 index 00000000..108a85d4 --- /dev/null +++ b/script/init.Debian @@ -0,0 +1,64 @@ +#!/bin/sh +# +# Note: this is not 100% Debian style, at least it works for now. +# $Id$ +# +# description: Starts and stops the MBSE BBS. +# +# For Debian SYSV init style. + +# 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 + +PATH=/sbin:/bin:/usr/sbin:/usr/bin:$MBSE_ROOT/bin +DAEMON=$MBSE_ROOT/bin/mbtask +NAME=mbsebbs +DESC="MBSE BBS" + +export MBSE_ROOT + +# See how we were called. +case "$1" in + start) + echo -n "Starting $DESC: " + 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 -n "opened " + fi + echo "done." + ;; + stop) + echo -n "Stopping $DESC: " + 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 + start-stop-daemon --stop --signal 15 --user mbtask + echo "$NAME done." + ;; + force-reload|restart) + $0 stop + $0 start + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 +esac +exit 0 diff --git a/script/init.RedHat b/script/init.RedHat new file mode 100644 index 00000000..4a41c8f1 --- /dev/null +++ b/script/init.RedHat @@ -0,0 +1,105 @@ +#!/bin/sh +# +# chkconfig: 345 95 05 +# description: Starts and stops MBSE BBS. +# +# For RedHat, E-Smith and Mandrake SYSV init style. +# $Id$ +# +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +# Check that networking is up. +[ ${NETWORKING} = "no" ] && exit 1 + +# 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 + +SU="su" +# +# From RedHat version 6.1 and up the behaviour of "su" has changed. +# Extra tests are added for the RedHat e-smith server distribution, +# this is a special distribution based on RedHat. +# For Mandrake we follow the same behaviour. +# +if [ -f /etc/mandrake-release ]; then + # + # Mandrake 6.0 and newer, use "su -" + # + RHR="`cat /etc/mandrake-release | awk '{ print $4 }' | tr -d .`" + if [ $RHR -gt 60 ]; then + SU="su -" + fi +else + if [ -f /etc/redhat-release ]; then + if [ -z "`grep e-smith /etc/redhat-release`" ]; then + # Standard RedHat + RHR=`cat /etc/redhat-release | awk '{ print $5 }' | tr -d .` + else + # E-Smith server based on RedHat + RHR=`cat /etc/redhat-release | awk '{ print $13 }' | tr -d . | tr -d \)` + fi + if [ $RHR -gt 60 ]; then + SU="su -" + fi + fi +fi + + +# See how we were called. +case "$1" in + start) + echo -n "Starting MBSE BBS: " + 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" + fi + touch /var/lock/subsys/mbsed + ;; + stop) + echo -n "Shutting down MBSE BBS: " + if [ -f $MBSE_ROOT/etc/config.data ]; then + echo -n "logoff users " + $SU mbse -c '$MBSE_ROOT/bin/mbstat close wait -quiet' >/dev/null + echo -n "done, " + fi + echo -n "stop mbtask: " + killproc mbtask -15 + rm -f /var/lock/subsys/mbsed + echo "done." + ;; + status) + status mbsed + ;; + restart|reload) + $0 stop + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart|reload|status}" + exit 1 +esac +exit 0 diff --git a/script/init.Slackware b/script/init.Slackware new file mode 100644 index 00000000..8d507d27 --- /dev/null +++ b/script/init.Slackware @@ -0,0 +1,69 @@ +#!/bin/sh +# +# description: Starts and stops MBSE BBS. +# +# $Id$ +# +# /etc/rc.d/init.d for Slackware +# + +# 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) + echo -n "MBSE BBS starting:" + 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 " and opened the bbs." + fi + ;; + stop) + echo -n "MBSE BBS shutdown:" + if [ -f $MBSE_ROOT/etc/config.data ]; then + echo -n " logoff users " + su mbse -c '$MBSE_ROOT/bin/mbstat close wait -quiet' >/dev/null + echo -n "done," + fi + echo -n " stopping mbtask " + kill -15 `pidof $MBSE_ROOT/bin/mbtask` + echo "done." + ;; + status) + echo -n "MBSE BBS status: " + if [ "`/sbin/pidof mbtask`" = "" ]; then + echo "mbtask is NOT running" + else + echo "mbtask Ok" + fi + ;; + restart|reload) + $0 stop + $0 start + ;; + *) + echo "Usage: $0 {start|stop|reload|restart|status}" + exit 1 +esac +exit 0 diff --git a/script/init.SuSE b/script/init.SuSE new file mode 100644 index 00000000..021cd8a0 --- /dev/null +++ b/script/init.SuSE @@ -0,0 +1,68 @@ +#!/bin/bash +# +# $Id$ +# +# /sbin/init.d/mbsed for SuSE +# + +# 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 + +case "$1" in + start) + echo -n "MBSE BBS starting:" + 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 " and opened the bbs." + else + echo "" + fi + ;; + stop) + echo -n "MBSE BBS shutdown:" + if [ -f $MBSE_ROOT/etc/config.data ]; then + echo -n " logoff users " + su mbse -c '$MBSE_ROOT/bin/mbstat close wait -quiet' >/dev/null + echo -n "done," + fi + echo -n " stopping mbtask " + killproc $MBSE_ROOT/bin/mbtask -15 + echo "done." + ;; + restart|reload) + $0 stop + $0 start + ;; + status) + echo -n "MBSE BBS status: " + if [ "`/sbin/pidof mbtask`" = "" ]; then + echo "mbtask is NOT running" + else + echo "mbtask Ok" + fi + ;; + *) + echo "Usage: $0 {start|stop|status|reload|restart}" + exit 1 +esac +exit 0 diff --git a/script/installinit.sh b/script/installinit.sh index 551aeb57..6d970b9b 100644 --- a/script/installinit.sh +++ b/script/installinit.sh @@ -147,79 +147,8 @@ if [ "$DISTNAME" = "SuSE" ]; then echo "Installing SystemV init scripts for SuSE" log "+" "Installing SystemV init scripts for SuSE" echo "Adding $DISTINIT" - -cat << EOF >$DISTINIT -#!/bin/bash -# Copyright (c) 2001 Michiel Broek -# -# Author: Michiel Broek , 23-May-2001 -# -# $DISTINIT for SuSE -# - -# 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 - -case "\$1" in - start|reload) - echo -n "MBSE BBS starting:" - 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 " and opened the bbs." - else - echo "" - fi - ;; - stop) - echo -n "MBSE BBS shutdown:" - if [ -f \$MBSE_ROOT/etc/config.data ]; then - echo -n " logoff users " - $SU mbse -c '\$MBSE_ROOT/bin/mbstat close wait -quiet' >/dev/null - echo -n "done," - fi - echo -n " stopping mbtask " - killproc \$MBSE_ROOT/bin/mbtask -15 - echo "done." - ;; - restart) - echo "Restarting MBSE BBS: just kidding!" - ;; - status) - echo -n "MBSE BBS status: " - if [ "\`/sbin/pidof mbtask\`" = "" ]; then - echo "mbtask is NOT running" - else - echo "mbtask Ok" - fi - ;; - *) - echo "Usage: \$0 {start|stop|status|reload|restart}" - exit 1 -esac -exit 0 -EOF - - chmod 755 /etc/rc.d/init.d/mbsed + cp init.SuSE $DISTINIT + chmod 755 $DISTINIT echo "Making links for start/stop in runlevel 2" ln -s ../mbsed /sbin/init.d/rc2.d/K05mbsed ln -s ../mbsed /sbin/init.d/rc2.d/S99mbsed @@ -272,78 +201,7 @@ if [ "$DISTNAME" = "Slackware" ]; then echo "Adding SystemV Slackware MBSE BBS start/stop scripts" log "+" "Adding SystemV Slackware MBSE BBS start/stop scripts" checkrcdir - -cat << EOF >$DISTINIT -#!/bin/sh -# -# description: Starts and stops MBSE BBS. -# -# Author: Michiel Broek , 23-May-2001 -# -# $DISTINIT for Slackware -# - -# 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) - echo -n "MBSE BBS starting:" - 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 " and opened the bbs." - fi - ;; - stop) - echo -n "MBSE BBS shutdown:" - if [ -f \$MBSE_ROOT/etc/config.data ]; then - echo -n " logoff users " - $SU mbse -c '\$MBSE_ROOT/bin/mbstat close wait -quiet' >/dev/null - echo -n "done," - fi - echo -n " stopping mbtask " - kill -15 \`pidof \$MBSE_ROOT/bin/mbtask\` - echo "done." - ;; - status) - echo -n "MBSE BBS status: " - if [ "\`/sbin/pidof mbtask\`" = "" ]; then - echo "mbtask is NOT running" - else - echo "mbtask Ok" - fi - ;; - restart) - echo "Restarting MBSE BBS: just kidding!" - ;; - *) - echo "Usage: mbsed {start|stop|restart|status}" - exit 1 -esac - -exit 0 -EOF + cp init.Slackware $DISTINIT chmod 755 $DISTINIT if [ -f $MBSE_ROOT/bin/mbse.start ]; then echo "Removing old startup scripts" @@ -382,145 +240,51 @@ if [ "$DISTNAME" = "RedHat" ] || [ "$DISTNAME" = "Mandrake" ]; then log "+" "Adding RedHat/E-Smith/Mandrake SystemV init scripts" DISTINIT="/etc/rc.d/init.d/mbsed" - SU="su" # - # From RedHat version 6.1 and up the behaviour of "su" has changed. # Extra tests are added for the RedHat e-smith server distribution, # this is a special distribution based on RedHat. - # For Mandrake we follow the same behaviour. # if [ -f /etc/mandrake-release ]; then - RHR="`cat /etc/mandrake-release | awk '{ print $4 }' | tr -d .`" RHN="Mandrake" - if [ $RHR -gt 60 ]; then - echo "You are running Mandrake v6.1 or newer" - SU="su -" - else - echo "You are running Mandrake v6.0 or older" - fi else if [ -f /etc/redhat-release ]; then if [ -z "`grep e-smith /etc/redhat-release`" ]; then - RHR=`cat /etc/redhat-release | awk '{ print $5 }' | tr -d .` RHN="RedHat" else - RHR=`cat /etc/redhat-release | awk '{ print $13 }' | tr -d . | tr -d \)` RHN="e-smith based on RedHat" fi - if [ $RHR -gt 60 ]; then - echo "You are running $RHN v6.1 or newer" - SU="su -" - else - echo "You are running $RHN v6.0 or older" - fi else echo "You are in big trouble." fi fi echo "Adding startup file $DISTINIT" - -cat << EOF >$DISTINIT -#!/bin/sh -# -# chkconfig: 345 95 05 -# description: Starts and stops MBSE BBS. -# -# For RedHat, E-Smith and Mandrake SYSV init style. -# 20-Jan-2002 M. Broek -# -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Check that networking is up. -[ \${NETWORKING} = "no" ] && exit 1 - -# 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) - echo -n "Starting MBSE BBS: " - 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" - fi - touch /var/lock/subsys/mbsed - ;; - stop) - echo -n "Shutting down MBSE BBS: " - if [ -f \$MBSE_ROOT/etc/config.data ]; then - echo -n "logoff users " - $SU mbse -c '\$MBSE_ROOT/bin/mbstat close wait -quiet' >/dev/null - echo -n "done, " - fi - echo -n "stop mbtask: " - killproc mbtask -15 - rm -f /var/lock/subsys/mbsed - echo "done." - ;; - status) - status mbsed - ;; - restart) - echo "Restarting MBSE BBS: just kidding!" - ;; - *) - echo "Usage: mbsed {start|stop|restart|status}" - exit 1 -esac - -exit 0 -EOF - chmod 755 $DISTINIT - echo "Making links for stop in runlevels 0 and 6" - if [ -f /etc/rc.d/rc0.d/K05mbsed ]; then - rm /etc/rc.d/rc0.d/K05mbsed - fi - ln -s ../init.d/mbsed /etc/rc.d/rc0.d/K05mbsed - if [ -f /etc/rc.d/rc6.d/K05mbsed ]; then - rm /etc/rc.d/rc6.d/K05mbsed - fi - ln -s ../init.d/mbsed /etc/rc.d/rc6.d/K05mbsed - echo "Making links for start in runlevels 3 and 5" - if [ -f /etc/rc.d/rc3.d/S95mbsed ]; then - rm /etc/rc.d/rc3.d/S95mbsed - fi - ln -s ../init.d/mbsed /etc/rc.d/rc3.d/S95mbsed - if [ -f /etc/rc.d/rc5.d/S95mbsed ]; then - rm /etc/rc.d/rc5.d/S95mbsed - fi - ln -s ../init.d/mbsed /etc/rc.d/rc5.d/S95mbsed - if [ "$RHN" = "e-smith based on RedHat" ]; then - echo "Making link for start in runlevel 7" - if [ -f /etc/rc.d/rc7.d/S95mbsed ]; then - rm /etc/rc.d/rc7.d/S95mbsed - fi - ln -s ../init.d/mbsed /etc/rc.d/rc7.d/S95mbsed + cp init.RedHat $DISTINIT + chmod 755 $DISTINIT + echo "Making links for stop in runlevels 0 and 6" + if [ -f /etc/rc.d/rc0.d/K05mbsed ]; then + rm /etc/rc.d/rc0.d/K05mbsed + fi + ln -s ../init.d/mbsed /etc/rc.d/rc0.d/K05mbsed + if [ -f /etc/rc.d/rc6.d/K05mbsed ]; then + rm /etc/rc.d/rc6.d/K05mbsed + fi + ln -s ../init.d/mbsed /etc/rc.d/rc6.d/K05mbsed + echo "Making links for start in runlevels 3 and 5" + if [ -f /etc/rc.d/rc3.d/S95mbsed ]; then + rm /etc/rc.d/rc3.d/S95mbsed + fi + ln -s ../init.d/mbsed /etc/rc.d/rc3.d/S95mbsed + if [ -f /etc/rc.d/rc5.d/S95mbsed ]; then + rm /etc/rc.d/rc5.d/S95mbsed + fi + ln -s ../init.d/mbsed /etc/rc.d/rc5.d/S95mbsed + if [ "$RHN" = "e-smith based on RedHat" ]; then + echo "Making link for start in runlevel 7" + if [ -f /etc/rc.d/rc7.d/S95mbsed ]; then + rm /etc/rc.d/rc7.d/S95mbsed fi + ln -s ../init.d/mbsed /etc/rc.d/rc7.d/S95mbsed + fi fi @@ -534,73 +298,7 @@ if [ "$DISTNAME" = "Debian" ]; then echo "You are running Debian Linux $DISTVERS" log "+" "Adding Debian SystemV init script" DISTINIT="/etc/init.d/mbsebbs" - -cat << EOF >$DISTINIT -#!/bin/sh -# -# Note: this is not 100% Debian style, at least it works for now. -# 23-May-2001 Michiel Broek. -# -# description: Starts and stops the MBSE BBS. - -# For Debian SYSV init style. - -# 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 - -PATH=/sbin:/bin:/usr/sbin:/usr/bin:\$MBSE_ROOT/bin -DAEMON=\$MBSE_ROOT/bin/mbtask -NAME=mbsebbs -DESC="MBSE BBS" - -export MBSE_ROOT - -# See how we were called. -case "\$1" in - start) - echo -n "Starting \$DESC: " - 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 -n "opened " - fi - echo "done." - ;; - stop) - echo -n "Stopping \$DESC: " - 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 - start-stop-daemon --stop --signal 15 --user mbtask - echo "\$NAME done." - ;; - force-reload|restart) - echo "Restarting \$DESC: is not possible, done." - ;; - *) - N=/etc/init.d/\$NAME - echo "Usage: \$N {start|stop|restart|force-reload}" >&2 - exit 1 -esac - -exit 0 -EOF + cp init.Debian $DISTINIT chmod 755 $DISTINIT update-rc.d mbsebbs defaults echo "Debian install ready." @@ -615,7 +313,7 @@ fi # if [ "$DISTNAME" = "FreeBSD" ] || [ "$DISTNAME" = "NetBSD" ]; then # - # FreeBSD init + # FreeBSD, NetBSD init # DISTINIT="$MBSE_ROOT/etc/rc" echo "Adding $DISTNAME style MBSE BBS start/stop scripts" diff --git a/script/mbse.start b/script/mbse.start index 396f1eca..0610c3c6 100644 --- a/script/mbse.start +++ b/script/mbse.start @@ -1,9 +1,9 @@ # -# ~/bin/mbse.start # BBS Startup script, should be run as BBS owner. -# Note: This is only used on Slackware systems until 7.0.0 and FreeBSD +# Note: This is only used on Slackware systems until 7.0.0, FreeBSD and NetBSD. +# +# $Id$ # -# 25-Oct-2001 MB. if [ "$MBSE_ROOT" = "" ]; then export MBSE_ROOT=`cat /etc/passwd | grep mbse: | awk -F ':' '{ print $6}'` diff --git a/script/mbse.stop b/script/mbse.stop index 3ad85cff..806f8663 100644 --- a/script/mbse.stop +++ b/script/mbse.stop @@ -1,9 +1,9 @@ # -# ~/bin/mbse.start # BBS Shutdown script, should be run as BBS owner. -# Note: this is only used on Slackware and FreeBSD systems. +# Note: this is only used on old Slackware, FreeBSD and NetBSD systems. +# +# $Id$ # -# 13-Aug-2001 MB. export PATH="/sbin:/usr/sbin:/bin:/usr/bin:$MBSE_ROOT/bin:" diff --git a/script/midnight b/script/midnight index 494c7632..195324a8 100644 --- a/script/midnight +++ b/script/midnight @@ -2,7 +2,7 @@ # # MBSE BBS Midnight - Should be run from cron at 00:00 # -# 26-Aug-1999 MB. +# $Id$ if [ "$MBSE_ROOT" = "" ]; then export MBSE_ROOT=`cat /etc/passwd | grep mbse: | awk -F ':' '{ print $6}'` diff --git a/script/monthly b/script/monthly index 7eeaddcc..4343209e 100644 --- a/script/monthly +++ b/script/monthly @@ -2,7 +2,7 @@ # # MBSE BBS Monthly - Should be run at the first of the month at 00:10 # -# 26-Aug-1999 MB. +# $Id$ if [ "$MBSE_ROOT" = "" ]; then export MBSE_ROOT=`cat /etc/passwd | grep mbse: | awk -F ':' '{ print $6}'` diff --git a/script/rc b/script/rc index 73610f4d..ad3516ea 100644 --- a/script/rc +++ b/script/rc @@ -1,8 +1,8 @@ #!/bin/sh # -# $MBSE_ROOT/etc/rc: BBS Startup script for Slackware and FreeBSD +# $MBSE_ROOT/etc/rc: BBS Startup script for old Slackware, FreeBSD and NetBSD # -# 13-Aug-2001 +# $Id$ # Remove stale tempfiles from cron. rm -f /tmp/cron.mbse.* diff --git a/script/rc.shutdown b/script/rc.shutdown index 237e8cfd..84f75091 100644 --- a/script/rc.shutdown +++ b/script/rc.shutdown @@ -1,8 +1,8 @@ #!/bin/sh # -# /opt/mbse/etc/rc.shutdown: BBS Shutdown script for Slackware and FreeBSD +# /opt/mbse/etc/rc.shutdown: BBS Shutdown script for Slackware, FreeBSD and NetBSD. # -# 13-Aug-2001 +# $Id$ if [ "$MBSE_ROOT" = "" ]; then export MBSE_ROOT=`cat /etc/passwd | grep mbse: | awk -F ':' '{ print $6}'` diff --git a/script/weekly b/script/weekly index 41004a96..6bef3be0 100644 --- a/script/weekly +++ b/script/weekly @@ -2,7 +2,7 @@ # # MBSE BBS Weekly - Should be run every week at sunday from cron at 00:05 # -# 26-Aug-1999 MB. +# $Id$ if [ "$MBSE_ROOT" = "" ]; then export MBSE_ROOT=`cat /etc/passwd | grep mbse: | awk -F ':' '{ print $6}'`