Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-testing > by-pkgid > 69ad6d1b8ee1e33fb9804f7479b72e2f > files > 4

lirc-0.8.2-1.20080310.2.2mdv2008.1.x86_64.rpm

#!/bin/sh  
#
# lircmd	Linux Infrared Remote Control mouse daemon
#
# chkconfig:    2345 92 8
# description:  LIRC is a package that allows you to decode and send
#               infrared signals of many (but not all) commonly used
#               remote controls.
#
# processname:  lircmd
# pidfile:      /var/run/lircmd.pid
# config:	/etc/lircmd.conf

### BEGIN INIT INFO
# Provides: lircmd
# Required-Start: lircd
# Required-Stop: lircd
# Default-Start: 2 3 4 5
# Short-Description: Linux Infrared Remote Control mouse daemon
# Description: LIRC is a package that allows you to decode and send
#              infrared signals of many (but not all) commonly used
#              remote controls.
### END INIT INFO

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

# See how we were called.
case "$1" in

  start)    # Check if the service is already running?
    	    if [ ! -f /var/lock/subsys/lircmd ]; then

                gprintf "Starting Linux Infrared Remote Control mouse daemon:"
                daemon lircmd
		RETVAL=$?
		[ ${RETVAL} -eq 0 ] && touch /var/lock/subsys/lircmd

    	    else

                gprintf "Stopping Linux Infrared Remote Control mouse daemon:"
		failure
		exit 1

    	    fi

	    echo
    	    ;;

  stop)	    # Stop daemons.
    	    if [ -f /var/lock/subsys/lircmd ]; then

		gprintf "Stopping Linux Infrared Remote Control mouse daemon:"
		killproc lircmd
		rm -f /var/lock/subsys/lircmd >/dev/null 2>&1

	    else

		gprintf "Stopping Linux Infrared Remote Control mouse daemon:"
		failure
                exit 1

    	    fi

	    echo
    	    ;;

  status)   status lircmd
	    ;;

  restart)  $0 stop
    	    $0 start
    	    ;;

  reload)   gprintf "Reloading Linux Infrared Remote Control mouse daemon:"
	    killproc lircmd -HUP
	    echo
	    ;;

  *)
    	    gprintf "$0 {start|stop|status|restart|reload}\n"
    	    exit 1
	    ;;

esac

exit ${RETVAL}