Fixed compiler warnings

This commit is contained in:
Michiel Broek
2011-05-22 17:43:12 +02:00
parent 560ec44062
commit 7d34abbef5
38 changed files with 174 additions and 210 deletions

61
script/init.Arch Normal file
View File

@@ -0,0 +1,61 @@
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
MBSE_ROOT=`cat /etc/passwd | grep ^mbse: | awk -F ':' '{ print $6}'`
export MBSE_ROOT
case "$1" in
start)
stat_busy "Starting MBSE BBS"
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
add_daemon mbtask
sleep 2
if [ -f ${MBSE_ROOT}/etc/config.data ]; then
su mbse -c '${MBSE_ROOT}/bin/mbstat open -quiet'
stat_done
else
stat_fail
exit 1
fi
;;
stop)
stat_busy "Stopping MBSE BBS"
if [ -f ${MBSE_ROOT}/var/run/mbtask ]; then
stat_append "logoff users"
su mbse -c '${MBSE_ROOT}/bin/mbstat close wait -quiet' >/dev/null
stat_append " done, stopping mbtask"
kill -15 `cat ${MBSE_ROOT}/var/run/mbtask`
i=10; doit=1;
while let 'i > 0' && let 'doit != 0'
do
if [ -f ${MBSE_ROOT}/var/run/mbtask ]; then
stat_append "."
sleep 1
let i=i-1
else
doit=0
fi
done
if [ -f ${MBSE_ROOT}/var/run/mbtask ]; then
kill -9 `cat ${MBSE_ROOT}/var/run/mbtask`
fi
fi
rm_daemon mbtask
stat_done
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
;;
esac
exit 0

View File

@@ -1,6 +1,4 @@
#
# $Id: installinit.sh,v 1.22 2008/11/18 21:03:08 mbse Exp $
#
# Installation script to install bootscripts.
#
PATH=/bin:/sbin:/usr/bin:/usr/sbin:${MBSE_ROOT}/bin
@@ -87,6 +85,10 @@ if [ "$OSTYPE" = "Linux" ]; then
elif [ -f /etc/gentoo-release ]; then
DISTNAME="Gentoo"
DISTVERS=`cat /etc/gentoo-release | awk '{ print $5 }'`
elif [ -f /etc/arch-release ]; then
DISTNAME="Arch Linux"
# No version, this is a rolling release system
DISTVERS="N/A"
else
DISTNAME="Unknown"
log "!" "unknown distribution, collecting data"
@@ -300,6 +302,20 @@ if [ "$DISTNAME" = "Gentoo" ]; then
fi
#--------------------------------------------------------------------------
#
# Adding scripts for Arch Linux
#
#
if [ "$DISTNAME" = "Arch Linux" ]; then
echo "You are running Arch Linux"
log "+" "Adding Arch Linux init script"
DISTINIT="/etc/rc.d/mbsebbs"
fi
#--------------------------------------------------------------------------
#
# Adding scripts for NetBSD