Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > media > contrib-backports > by-pkgid > 329fe7f528befb66dad30f6e838a27ab > files > 1

rocrail-1.3-0.rev986.2mdv2010.2.i586.rpm

#! /bin/sh

### BEGIN INIT INFO
# Provides:          rocrail
# Required-Start:    $network
# X-UnitedLinux-Should-Start: 
# Required-Stop:     
# X-UnitedLinux-Should-Stop: 
# Default-Start:     3
# Default-Stop:      
# Short-Description: Starts the Rocrail Daemon
# Description:       Starts the Rocrail Daemon
### END INIT INFO

rocraild_BIN=/usr/lib/rocrail/rocrail
rocraild_PID=/var/run/rocraild.pid
rocraild_SH=/usr/lib/rocrail/rocraild.sh

if [ ! -x $rocraild_BIN ] ; then
	echo -n "Rocrail not installed ! "
	exit 5
fi

case "$1" in
    start)
	if [ ! -e $rocraild_PID ] ; then
		echo "Starting Rocrail"
	else
		echo "rocraild.pid already exists ! "
		exit 5
	fi
 	su - root -c "$rocraild_SH"
	;;
    stop)
	if [ -e $rocraild_PID ] ; then
		echo "Shutting down Rocrail"
	else
		echo "Rocrail not running or missing PID File ! "
		exit 5
	fi
	su - root -c "kill `head $rocraild_PID`"
	su - root -c "rm $rocraild_PID"
	;;
*)
	echo "Usage: $0 {start|stop}"
	exit 1

esac