summaryrefslogtreecommitdiff
path: root/net-misc/dahdi-tools/files/dahdi.init2
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/dahdi-tools/files/dahdi.init2')
-rw-r--r--net-misc/dahdi-tools/files/dahdi.init236
1 files changed, 36 insertions, 0 deletions
diff --git a/net-misc/dahdi-tools/files/dahdi.init2 b/net-misc/dahdi-tools/files/dahdi.init2
new file mode 100644
index 000000000000..d3abf3c4e61e
--- /dev/null
+++ b/net-misc/dahdi-tools/files/dahdi.init2
@@ -0,0 +1,36 @@
+#!/sbin/openrc-run
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [ ! -f /etc/dahdi/system.conf ]; then
+ eerror "/etc/dahdi/system.conf not found. Nothing to do."
+ return 1
+ fi
+
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting DAHDI"
+ /usr/sbin/dahdi_cfg
+ eend $?
+
+ if [ $? -eq 0 -a -r /etc/fxotune.conf ]; then
+ ebegin "Loading DAHDI fxotune.conf"
+ /usr/sbin/fxotune -s
+ eend $?
+ fi
+}
+
+stop() {
+ ebegin "Stopping DAHDI"
+ /usr/sbin/dahdi_cfg -s
+ eend
+}