summaryrefslogtreecommitdiff
blob: b6d2c590c19e8d364cb825f6e213d22b50d910ca (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
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-dialup/ivam2/files/ivam2.init,v 1.2 2005/08/19 20:51:57 sbriesen Exp $

opts="reload info"

depend() {
	need isdn
}

start() {
	local CONFIG="/etc/ivam2/ivam2.conf"
 
	if [ ! -e "$CONFIG" ] ; then
		eerror "You're missing ${CONFIG}"
		return 1
	fi

	source "$CONFIG"

	ebegin "Starting ISDN Voice Box Answering Machine"
	start-stop-daemon --start --quiet --pidfile /var/run/ivamd.pid \
		--exec /usr/sbin/ivamd -- ${ARGS} 2>/dev/null
	eend $?
}

stop() {
	ebegin "Stopping ISDN Voice Box Answering Machine"
	start-stop-daemon --stop --quiet --retry 5 --pidfile /var/run/ivamd.pid >/dev/null && \
	/usr/bin/find /var/lock -user ivam -prune | /usr/bin/xargs /bin/rm -f /var/run/ivamd.pid
	eend $?
}

reload() {
	ebegin "Reloading ISDN Voice Box Answering Machine"
	/usr/sbin/ivamd --reload 2>/dev/null
	eend $?
}

info() {
	/usr/sbin/ivamd --info 
}