From 54bcbdf2afe09939a73e2a5a8e0c8818905c1cd0 Mon Sep 17 00:00:00 2001
From: Greg Frost <gregfrost1@bigpond.com>
Date: Wed, 1 Jul 2009 13:20:17 +0930
Subject: runit-scripts: add smartd sv scripts

---
 abs/core-testing/runit-scripts/PKGBUILD                     |  2 +-
 .../runit-scripts/runitscripts/services/smartd/finish       |  9 +++++++++
 .../runit-scripts/runitscripts/services/smartd/run          | 13 +++++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100755 abs/core-testing/runit-scripts/runitscripts/services/smartd/finish
 create mode 100755 abs/core-testing/runit-scripts/runitscripts/services/smartd/run

diff --git a/abs/core-testing/runit-scripts/PKGBUILD b/abs/core-testing/runit-scripts/PKGBUILD
index 852c658..3d9c25a 100755
--- a/abs/core-testing/runit-scripts/PKGBUILD
+++ b/abs/core-testing/runit-scripts/PKGBUILD
@@ -1,6 +1,6 @@
 pkgname=runit-scripts
 pkgver=1.8.0
-pkgrel=88
+pkgrel=89
 pkgdesc="collection of startup scripts for runit"
 url="http://smarden.org/runit/"
 license="BSD"
diff --git a/abs/core-testing/runit-scripts/runitscripts/services/smartd/finish b/abs/core-testing/runit-scripts/runitscripts/services/smartd/finish
new file mode 100755
index 0000000..7b77994
--- /dev/null
+++ b/abs/core-testing/runit-scripts/runitscripts/services/smartd/finish
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+ . /etc/rc.conf
+ . /etc/rc.d/functions
+
+     stat_runit "Stopping smartd"
+     kill -9 `pidof /usr/sbin/smartd` &>/dev/null
+     rm_daemon smartd
+     stat_done
diff --git a/abs/core-testing/runit-scripts/runitscripts/services/smartd/run b/abs/core-testing/runit-scripts/runitscripts/services/smartd/run
new file mode 100755
index 0000000..15ed769
--- /dev/null
+++ b/abs/core-testing/runit-scripts/runitscripts/services/smartd/run
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+ . /etc/rc.conf
+ . /etc/rc.d/functions
+
+     stat_runit "Starting smartd"
+     /usr/sbin/smartd -n -c /etc/smartd.conf -q never &>/dev/null
+     if [ $? -ne 0 ]; then
+       stat_fail
+     else
+       add_daemon smartd
+       stat_done
+     fi
-- 
cgit v0.12

