summaryrefslogtreecommitdiff
blob: be5a086e72f615e3bd5a7561a3c70b26858e44a0 (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
#!/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/isdn4k-utils/files/3.5_pre20041110/isdnlog.init,v 1.1 2004/11/22 20:05:39 mrness Exp $

opts="start stop"

depend() {
	need isdn
}

start() {
	local CONTR="${myservice#*.contr}" CTRL=$((CONTR * 2))
	local CONFIG="/etc/isdn/isdnlog.isdnctrl${CTRL}.options"
	[ -e "$CONFIG" ] || CONFIG="/etc/isdn/isdnlog.options.contr${CONTR}"
 
	if [ ! -e "$CONFIG" ] ; then
		eerror "You're missing ${CONFIG}"
		return 1
	fi

	ebegin "Starting ISDNLOG for controller #${CONTR}"
	start-stop-daemon --start --quiet --pidfile "/var/run/isdnlog.isdnctrl${CTRL}.pid" \
		--exec /usr/sbin/isdnlog -- ${ISDNLOG_OPTIONS} -f "${CONFIG}" "/dev/isdnctrl${CTRL}"
	eend $?
}

stop() {
        local CONTR="${myservice#*.contr}" CTRL=$((CONTR * 2))
	ebegin "Stopping ISDNLOG for controller #${CONTR}"
	start-stop-daemon --stop --quiet --retry 5 --pidfile "/var/run/isdnlog.isdnctrl${CTRL}.pid"
	eend $?
}