diff options
author | James Meyer <James.meyer@operamail.com> | 2008-10-02 03:19:12 (GMT) |
---|---|---|
committer | James Meyer <James.meyer@operamail.com> | 2008-10-02 03:19:12 (GMT) |
commit | 0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a (patch) | |
tree | c0aa2c0b53c317be87eacfcb77b63f53f1f415e7 /abs/core/runit/runitscripts/services/lircd | |
download | linhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.zip linhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.tar.gz linhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.tar.bz2 |
initial import
Diffstat (limited to 'abs/core/runit/runitscripts/services/lircd')
-rwxr-xr-x | abs/core/runit/runitscripts/services/lircd/finish | 12 | ||||
-rwxr-xr-x | abs/core/runit/runitscripts/services/lircd/run | 39 |
2 files changed, 51 insertions, 0 deletions
diff --git a/abs/core/runit/runitscripts/services/lircd/finish b/abs/core/runit/runitscripts/services/lircd/finish new file mode 100755 index 0000000..3545b07 --- /dev/null +++ b/abs/core/runit/runitscripts/services/lircd/finish @@ -0,0 +1,12 @@ +#!/bin/bash +killall -9 lircd +rm -f /var/run/lirc*.pid +touch /etc/sv/lircd/.runtime/`date +%s` +numfiles=`/usr/bin/file_time_offset.py -s4 -d/etc/sv/lircd/.runtime ` +if [ $numfiles -gt 3 ] +then + rm -f /etc/sv/lircd/.runtime/* + ls -la /etc/sv/lircd/.runtime/* + sv stop lircd + echo "lircd is not able to start, disabling it" +fi diff --git a/abs/core/runit/runitscripts/services/lircd/run b/abs/core/runit/runitscripts/services/lircd/run new file mode 100755 index 0000000..4457b37 --- /dev/null +++ b/abs/core/runit/runitscripts/services/lircd/run @@ -0,0 +1,39 @@ +#!/bin/bash +exec 2>&1 +run_lircd2=false +. /etc/systemconfig +function imon_detect { +if [ -e /dev/lirc_imon ] +then +lircd2_cmd="/usr/sbin/lircd -d /dev/lirc_imon --output=/dev/lircd --pidfile=/var/run/lircd2.pid --connect=localhost:8765" +run_lircd2=true +fi +} + + + +case $ReceiverType in + Serial) + /usr/bin/setserial /dev/$ReceiverSerialport uart none + /sbin/modprobe lirc_serial + DEVICE=`ls /dev/lirc[0-9] 2>/dev/null |sort |sed '/./,$!d'|head -n 1 ` + imon_detect + ;; + Usb-imon) + DEVICE=/dev/lirc_imon + ;; + + *) + + DEVICE=`ls /dev/lirc[0-9] 2>/dev/null |sort |sed '/./,$!d'|head -n 1 ` + imon_detect + ;; +esac + +if [ "$run_lircd2" = "true" ] +then + $lircd2_cmd 2>/dev/null 1>/dev/null + exec /usr/sbin/lircd -n -d $DEVICE --output /dev/lircd1 --listen 2>/dev/null 1>/dev/null +else + exec /usr/sbin/lircd -n -d $DEVICE 2>/dev/null 1>/dev/null +fi |