Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 4b85500aed8461e0ec492003e191a106 > files > 1

cddb-proxy-1.7-5mdk.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)
        gprintf "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)
        gprintf "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=$?
	;;
  *)
	gprintf "Usage: cddbp {start|stop|restart}\n"
	exit 1
esac

exit 0