From 328b8e929de3d3d53044cc17f107752a4cb2984c Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Thu, 29 Jan 2015 18:53:41 +0000
Subject: runit-scripts: add irexec service for runit to manage

---
 abs/core/runit-scripts/PKGBUILD                         |  2 +-
 abs/core/runit-scripts/runit.install                    |  6 ++++++
 abs/core/runit-scripts/runitscripts/services/irexec/run | 12 ++++++++++++
 3 files changed, 19 insertions(+), 1 deletion(-)
 create mode 100644 abs/core/runit-scripts/runitscripts/services/irexec/run

diff --git a/abs/core/runit-scripts/PKGBUILD b/abs/core/runit-scripts/PKGBUILD
index 35620e6..9d119a1 100755
--- a/abs/core/runit-scripts/PKGBUILD
+++ b/abs/core/runit-scripts/PKGBUILD
@@ -1,6 +1,6 @@
 pkgname=runit-scripts
 pkgver=8.3
-pkgrel=2
+pkgrel=3
 pkgdesc="collection of startup scripts for runit"
 url="http://smarden.org/runit/"
 license="BSD"
diff --git a/abs/core/runit-scripts/runit.install b/abs/core/runit-scripts/runit.install
index 4ec6a9f..3cf5036 100755
--- a/abs/core/runit-scripts/runit.install
+++ b/abs/core/runit-scripts/runit.install
@@ -39,6 +39,12 @@ post_upgrade(){
   then
       rm -r /etc/sv/lircd
   fi
+
+  # add irexec
+  if [ -e /service/remotes ] && [ ! -e /service/irexec ]
+  then
+      add_service.sh irexec
+  fi
 	 
 }
 
diff --git a/abs/core/runit-scripts/runitscripts/services/irexec/run b/abs/core/runit-scripts/runitscripts/services/irexec/run
new file mode 100644
index 0000000..55653a3
--- /dev/null
+++ b/abs/core/runit-scripts/runitscripts/services/irexec/run
@@ -0,0 +1,12 @@
+#!/bin/sh
+exec 2>&1
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+if [[ -z $(pidof lircd) ]]; then
+    stat_runit "No lircd process, can't start irexec"
+else
+    stat_runit "Starting irexec"
+    exec /usr/bin/irexec /etc/lircrc
+fi
-- 
cgit v0.12