summaryrefslogtreecommitdiff
blob: f0c77b9115be96e50d3eb64f51501a15e880a3ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/sbin/runscript
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

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

	if [ -x /opt/bin/dahdihpec_enable ]; then
		if grep -q "^echocanceller=hpec" /etc/dahdi/system.conf; then
			ebegin "Enabling HPEC"
			/opt/bin/dahdihpec_enable >/dev/null
			eend $?
		fi
	fi

	ebegin "Starting DAHDI"
	/usr/sbin/dahdi_cfg
	eend $?
}

stop() {
	ebegin "Stopping DAHDI"
	/usr/sbin/dahdi_cfg -s
	eend 
}