summaryrefslogtreecommitdiff
blob: 4a3e0269bae116cfa51572e722c491e2a5df1172 (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
#!/sbin/runscript
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

: ${configfile:=/etc/c-icap/c-icap.conf}

get_config() {
    local value=$(awk '$1 == "'$1'" { print $2 }' ${configfile})
    echo ${value:-$2}
}

command="/usr/libexec/c-icap"
command_arguments="${EXTRA_OPTS} -f ${configfile}"
pidfile=$(get_config PidFile /var/run/c-icap/c-icap.pid)

depend() {
	need localmount
	config ${configfile}
	[ "$(get_config Logger file_logger)" = "sys_logger" ] && use logger
}

start_pre() {
	local cmdsocket=$(get_config CommandsSocket /var/run/c-icap/c-icap.ctl)

	checkpath -d "$(dirname "${cmdsocket}")" "$(dirname "${pidfile}")"
}