blob: 1b9af8a9843babc81828318ed85bff5c41b798a2 (
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-dialup/capisuite/files/capisuite.initd,v 1.1 2005/05/16 08:46:39 genstef Exp $
opts="reload"
depend() {
need capi
}
checkconfig() {
local conf_fax conf_voice sec rest
# Check if there are configured users for fax or
# answering machine. Otherwise exit.
# IMPORTANT: Change this or comment it out if you want to use
# your own CapiSuite scripts.
while read -r sec rest; do
if [ "${sec:0:1}" = "[" -a "$sec" != "[GLOBAL]" ]; then
conf_fax=yes
break
fi
done < /etc/capisuite/fax.conf
while read -r sec rest; do
if [ "${sec:0:1}" = "[" -a "$sec" != "[GLOBAL]" ]; then
conf_voice=yes
break
fi
done < /etc/capisuite/answering_machine.conf
# end check for configured users
if ! [ "$conf_fax" -o "$conf_voice" ]; then
eerror "Please configure CapiSuite first!"
return 1
fi
return 0
}
start() {
checkconfig || return 1
ebegin "Starting CapiSuite"
start-stop-daemon --start --quiet --exec /usr/sbin/capisuite -- -d
eend $?
}
stop() {
ebegin "Stopping CapiSuite"
start-stop-daemon --stop --quiet --exec /usr/sbin/capisuite --retry 10 --signal TERM >/dev/null
eend $?
}
reload() {
ebegin "Reload CapiSuite"
start-stop-daemon --stop --quiet --exec /usr/sbin/capisuite --signal HUP
eend $?
}
|