#!/bin/sh

################################
## BLUETOOTH HCID INIT SCRIPT ##
################################

## Callum Dickinson <gcfreak_ag20@hotmail.com>
## Sonic Team Junior <http://www.srb2.org>
## http://mb.srb2.org/showthread.php?t=31137
## svn://code.srb2.org/SRB2/branches/WII

## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
## as published by the Free Software Foundation; either version 2
## of the License, or (at your option) any later version.

## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.


## Any lines in this file preceeded by a hash ('#') indicates a comment, and is not read by the interpreter.

#--------------------#
. /lib/lsb/init-functions
. /etc/profile
LOGFILE="$LOGDIR/$ME.log"
#--------------------#

case "$1" in
	"start") if [ "$FIRSTSTART" = "yes" ]; then
			if [ "$FIRSTSTARTOVER" = "yes" ]; then
				log_action_begin_msg "Mounting /proc and /sys"
				mount -n -t proc proc /proc > /dev/null 2>&1
				mount -n -t sysfs sysfs /sys > /dev/null 2>&1
				log_action_end_msg 0
			fi
		else
			log_action_begin_msg "Mounting /proc and /sys"
			mount -n -t proc proc /proc > /dev/null 2>&1
			mount -n -t sysfs sysfs /sys > /dev/null 2>&1
			log_action_end_msg 0
		fi
   		;;
	"stop") log_action_begin_msg "Unmounting /proc and /sys"
		umount /proc > /dev/null 2>&1
		umount /sys > /dev/null 2>&1
		log_action_end_msg 0
		;;
	restart|reload|force-reload) log_action_begin_msg "Remounting /proc and /sys"
		umount /proc > /dev/null 2>&1
		umount /sys > /dev/null 2>&1
		mount -n -t proc proc /proc > /dev/null 2>&1
		mount -n -t sysfs sysfs /sys > /dev/null 2>&1
		log_action_end_msg 0
   		;;
	*) print "Usage: /etc/init.d/kserv {start|stop|restart|reload|force-reload}" && exit 1;;
esac
