Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 3b7c3d28d2c75781bdace923ba18801b > files > 1

cddb-proxy-1.7-3mdk.noarch.rpm

#!/bin/sh
#
# chkconfig: 345 80 20
# description: start and stop the cddb-proxy

# Source function library.
. /etc/rc.d/init.d/functions

cddbp=/usr/sbin/cddbp2.pl
pidfile=/var/run/cddbp

[ -f $cddbp ] || exit 0

case "$1" in
  start)
        echo -n "Starting cddb proxy: "
	daemon perl $cddbp $pidfile >/dev/null&
	RETVAL=$?
	[ $RETVAL -eq 0 ] && \
	( touch /var/lock/subsys/cddbp ; success "cddbp startup" ) || \
	( RETVAL=1 ; failure "cddbp startup" )
	echo
	;;
  stop)
        echo -n "Shutting down cddb proxy: "
	( kill `cat $pidfile` ) 2>/dev/null
	RETVAL=$?
	[ $RETVAL -eq 0 ] && \
	( rm -f /var/lock/subsys/cddbp $pidfile ; \
	  success "cddbp shutdown" ) || \
	failure "cddbp shutdown"
	echo
	;;
  restart)
	$0 stop
	$0 start
	RETVAL=$?
	;;
  *)
	echo "Usage: cddbp {start|stop|restart}"
	exit 1
esac

exit 0