#!/bin/bash # # SetTopBox Automatically turn on and off the RCA SetTopBox # # Author: Rich West # # chkconfig: - 99 01 # # description: Turn on and off the set top box. # processname: directv.pl # # source function library . /etc/rc.d/init.d/functions RETVAL=0 start() { echo -n $"Turning on the SetTopBox:" /usr/local/bin/directv.pl on RETVAL=$? echo } stop() { echo -n $"Turning off the SetTopBox:" /usr/local/bin/directv.pl off RETVAL=$? echo } restart() { stop start } case "$1" in start) start ;; stop) stop ;; restart) restart ;; status) /usr/local/bin/directv.pl get_channel /usr/local/bin/directv.pl get_signal ;; *) echo $"Usage: $0 {start|stop|status|restart}" exit 1 esac exit $RETVAL