summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/dahdi-tools/files/dahdi.init')
-rw-r--r--net-misc/dahdi-tools/files/dahdi.init31
1 files changed, 31 insertions, 0 deletions
diff --git a/net-misc/dahdi-tools/files/dahdi.init b/net-misc/dahdi-tools/files/dahdi.init
new file mode 100644
index 0000000..483ec33
--- /dev/null
+++ b/net-misc/dahdi-tools/files/dahdi.init
@@ -0,0 +1,31 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dahdi-tools/files/dahdi.init,v 1.1 2009/03/10 17:08:01 chainsaw Exp $
+
+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 $?
+}
+
+stop() {
+ ebegin "Stopping DAHDI"
+ /usr/sbin/dahdi_cfg -s
+ eend
+}