File init.hdaps of Package hdapsd

#! /bin/sh
### BEGIN INIT INFO
# Provides:          hdaps
# Required-Start:    $local_fs
# Required-Stop:     $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      S 0 1 6
# Short-Description: Example initscript
# Description:       This file should be used to construct scripts to be
#                    placed in /etc/init.d.
### END INIT INFO

# Author:	Foo Bar <foobar@baz.org>.

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/usr/sbin:/usr/bin:/sbin:/bin
HDAPS_BIN=/usr/sbin/hdapsd
HDAPS_ARGS="-d sda -a -b"

# Exit if the package is not installed
test -x $HDAPS_BIN || { echo "$HDAPS_BIN not installed"; 
        if [ "$1" = "stop" ]; then exit 0;
        else exit 5; fi; }

# Read configuration variable file if it is present
#FOO_CONFIG=/etc/sysconfig/FOO
#test -r $FOO_CONFIG || { echo "$FOO_CONFIG not existing";
#        if [ "$1" = "stop" ]; then exit 0;
#        else exit 6; fi; }
# Read config   
#. $FOO_CONFIG

#. /lib/lsb/init-functions
. /etc/rc.status
rc_reset


case "$1" in
  start)
	echo -n "Starting hdaps"
	/sbin/startproc $HDAPS_BIN $HDAPS_ARGS
	rc_status -v
	;;
  stop)
	echo -n "Shutting down hdaps"
	/sbin/killproc -TERM $HDAPS_BIN
	rc_status -v
	;;
  restart|force-reload)
  	$0 stop
	$0 start
	rc_status
	;;
  *)
	echo "Usage: $0 {start|stop|restart|force-reload}" >&2
	exit 3
	;;
esac

:
openSUSE Build Service is sponsored by