* app-crypt/ekeyd: Add
[portage-overlay.git] / app-crypt / ekeyd / files / ekeyd.init.2
1 #!/sbin/runscript
2 # Copyright 1999-2011 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header: /var/cvsroot/gentoo-x86/app-crypt/ekeyd/files/ekeyd.init.2,v 1.1 2011/10/20 11:40:27 flameeyes Exp $
5
6 INSTANCE="${SVCNAME#*.}"
7 if [ -z "${INSTANCE}" -o "${SVCNAME}" = "ekeyd" ]; then
8         INSTANCE="ekeyd"
9 fi
10
11 description="EntropyKey daemon"
12
13 pidfile=/var/run/$SVCNAME.pid
14 cfgfile=/etc/entropykey/${INSTANCE}.conf
15
16 command=/usr/libexec/ekeyd
17 command_args="-f ${cfgfile} -p ${pidfile}"
18
19 depend() {
20          config $cfgfile
21
22          use udev ekey-ulusbd
23          need localmount
24
25          # quickly parse the configuration file; we only provide entropy
26          # if we're not using the egd server/client split method.
27          if sed -e 's:--.*::' "${cfgfile}" | grep -q SetOutputToKernel; then
28                  provide entropy
29          fi
30 }