File digiwake.init of Package digitools

#!/bin/sh
#
#
### BEGIN INIT INFO
# Provides:          digiwake
# Required-Start:    $local_fs
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: Wake-On-CIR for ASUS Digimatrix script
# Description:       Wake-On-CIR for ASUS Digimatrix script
#	This enables Wake-On-Remote-Controll for the ASUS Digimatrix
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DIGIWAKE=/usr/sbin/digiwake
WAKE_ON_CIR="no"

test -x $DIGIWAKE || exit 0

. /lib/lsb/init-functions

. /etc/rc.status

rc_reset


# Include digitools defaults if available
if [ -f /etc/default/digitools ] ; then
    . /etc/default/digitools
fi

if [ ! "${WAKE_ON_CIR}" == "yes" ] ; then
    exit 0
fi

set -e

case "$1" in
    start)
        echo -n "Enabling Wake-On-CIR: "
        ${DIGIWAKE} -w >/dev/null 2>&1
        rc_status -v
    ;;
    stop)
        echo -n "Enabling Wake-On-CIR: "
        ${DIGIWAKE} -w >/dev/null 2>&1
        rc_status -v
    ;;
    restart|reload|force-reload)
        echo -n "Enabling Wake-On-CIR: "
        ${DIGIWAKE} -w >/dev/null 2>&1
        rc_status -v
    ;;
    *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start}" >&2
        exit 1
    ;;
esac

rc_exit
openSUSE Build Service is sponsored by