From 08532d47763dea9985faa9ad996a31df87400fb7 Mon Sep 17 00:00:00 2001 From: James Meyer <james.meyer@operamail.com> Date: Thu, 25 Mar 2010 12:02:36 -0500 Subject: recstat: added run file. -More cleanup for recstat.py. -removed recstat which is used for init closes #632 --- abs/extra-testing/recstat/PKGBUILD | 12 ++++++------ abs/extra-testing/recstat/recstat.install | 1 + abs/extra-testing/recstat/recstat.py | 17 +++++++++-------- abs/extra-testing/recstat/run | 7 +++++++ 4 files changed, 23 insertions(+), 14 deletions(-) create mode 100755 abs/extra-testing/recstat/run diff --git a/abs/extra-testing/recstat/PKGBUILD b/abs/extra-testing/recstat/PKGBUILD index ba67bd5..023a0ed 100644 --- a/abs/extra-testing/recstat/PKGBUILD +++ b/abs/extra-testing/recstat/PKGBUILD @@ -1,19 +1,19 @@ pkgname=recstat pkgver=1 -pkgrel=13 +pkgrel=20 pkgdesc="pkg to help use the System LEDs for Recording Status" arch=('i686' 'x86_64') url="" depends=('python' 'python-pyserial') license=('GPL') -source=(recstat recstat.py) +source=(recstat recstat.py run) md5sums=('626acb8cdd9e5cdb3a502bc12b828067') install=recstat.install build () { - install -D $startdir/src/recstat $startdir/pkg/etc/rc.d/recstat +# install -D $startdir/src/recstat $startdir/pkg/etc/rc.d/recstat install -D $startdir/src/recstat.py $startdir/pkg/usr/bin/recstat.py + install -D $startdir/src/run $startdir/pkg/etc/sv/recstat/run } md5sums=('7f4ba41b65ed4d693d60d5ea00e8411b' - '9477fe77a716c308125eab521cf59f20') -md5sums=('7f4ba41b65ed4d693d60d5ea00e8411b' - '810ee7a073e8f417ab18e146ebf3b900') + '7bc206d78a096e6ee80b9bb346619ed4' + '3a7cd3382212650e9233b910ed28d046') diff --git a/abs/extra-testing/recstat/recstat.install b/abs/extra-testing/recstat/recstat.install index c45cc1b..ecd58f0 100644 --- a/abs/extra-testing/recstat/recstat.install +++ b/abs/extra-testing/recstat/recstat.install @@ -5,6 +5,7 @@ post_install() { echo "" echo " Edit /usr/bin/recstat.py to fit your tuner setup" echo " http://linhes.org/bugs/projects/lin-hes/wiki/_Using_System_LEDs_for_Recording_Status_" + echo " To start this program at boot run add_service.sh recstat " } op=$1 diff --git a/abs/extra-testing/recstat/recstat.py b/abs/extra-testing/recstat/recstat.py index 6e09da9..8def041 100644 --- a/abs/extra-testing/recstat/recstat.py +++ b/abs/extra-testing/recstat/recstat.py @@ -3,7 +3,7 @@ import httplib import serial,time -mythStatus = "localhost:6544" +mythStatus = "127.0.0.1:6544" encoder1 = "Encoder 1 " encoder2 = "Encoder 2 " recording = "is local on mythtv and is recording" @@ -27,11 +27,12 @@ while(True): s.setDTR(1) else: s.setDTR(0) - if(results.find(encoder2+recording)!=-1): - s.setRTS(1) - elif (results.find(encoder2+watching) !=-1): - s.setRTS(1) - else: - s.setRTS(0) + + if(results.find(encoder2+recording)!=-1): + s.setRTS(1) + elif (results.find(encoder2+watching) !=-1): + s.setRTS(1) + else: + s.setRTS(0) - time.sleep(1) + time.sleep(1) diff --git a/abs/extra-testing/recstat/run b/abs/extra-testing/recstat/run new file mode 100755 index 0000000..150fdb4 --- /dev/null +++ b/abs/extra-testing/recstat/run @@ -0,0 +1,7 @@ +#!/bin/sh +exec 2>&1 +export TERM=linux +. /etc/rc.conf +. /etc/rc.d/functions +stat_runit "Starting recstat" +exec /usr/bin/recstat.py -- cgit v0.12