summaryrefslogtreecommitdiff
blob: 22c1ebe5bda0e5160afb43d60bc56ed58e03df4d (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
#!/sbin/openrc-run
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

INSTANCE="${SVCNAME#*.}"
if [ -z "${INSTANCE}" -o "${SVCNAME}" = "ekeyd" ]; then
	INSTANCE="ekeyd"
fi

description="EntropyKey daemon"

pidfile=/var/run/$SVCNAME.pid
cfgfile=/etc/entropykey/${INSTANCE}.conf

command=/usr/libexec/ekeyd
command_args="-f ${cfgfile} -p ${pidfile}"

depend() {
	 config $cfgfile

	 use udev ekey-ulusbd
	 need localmount

	 # quickly parse the configuration file; we only provide entropy
	 # if we're not using the egd server/client split method.
	 if sed -e 's:--.*::' "${cfgfile}" | grep -q SetOutputToKernel; then
		 provide entropy
	 fi
}