#!/bin/sh
#
### BEGIN INIT INFO
# Provides: aksusbd
# Required-Start: @@@AKSUSBREQSTART@@@
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Description:  Aladdin AKSUSB daemon
### END INIT INFO
# $Id: aksusbd.suse,v 1.4 2002/10/28 11:23:08 chris Exp $

. /etc/rc.status
#. /etc/rc.config

## Determine the base and follow a runlevel link name.
#base=${0##*/}
#link=${base#*[SK][0-9][0-9]}
#
## Force execution if not called by a runlevel directory.
#test $link = $base && START_AKSUSBD=yes
#test "$START_AKSUSBD" = yes || exit 0
#
# Shell functions sourced from /etc/rc.status:
#      rc_check         check and set local and overall rc status
#      rc_status        check and set local and overall rc status
#      rc_status -v     ditto but be verbose in local rc status
#      rc_status -v -r  ditto and clear the local rc status
#      rc_failed        set local and overall rc status to failed
#      rc_reset         clear local rc status (overall remains)
#      rc_exit          exit appropriate to overall rc status

# First reset status of this service
rc_reset
case "$1" in
    start)
	echo -n "Starting AKSUSB daemon"

	startproc @@@AKSUSBDDESTDIR@@@/aksusbd

	# Remember status and be verbose
	rc_status -v
	;;
    stop)
	echo -n "Shutting down AKSUSB daemon"

	killproc -TERM @@@AKSUSBDDESTDIR@@@/aksusbd

	# Remember status and be verbose
	rc_status -v
	;;
    restart)
	$0 stop  &&  $0 start

	# Remember status and be quiet
	rc_status
	;;
    reload)

	$0 stop  &&  $0 start

	# Remember status and be verbose
	rc_status -v
	;;
    status)
	echo -n "Checking for AKSUSB daemon: "

	checkproc @@@AKSUSBDDESTDIR@@@/aksusbd && echo OK || echo No process
	;;
    *)
	echo "Usage: $0 {start|stop|status|restart|reload}"
	exit 1
	;;
esac
rc_exit
