diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
commit | 8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch) | |
tree | 7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-crypt/ekeyd/files/ekey-ulusbd.init.2 | |
parent | 30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff) |
gentoo resync : 14.07.2018
Diffstat (limited to 'app-crypt/ekeyd/files/ekey-ulusbd.init.2')
-rw-r--r-- | app-crypt/ekeyd/files/ekey-ulusbd.init.2 | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/app-crypt/ekeyd/files/ekey-ulusbd.init.2 b/app-crypt/ekeyd/files/ekey-ulusbd.init.2 new file mode 100644 index 000000000000..ef52db2a6685 --- /dev/null +++ b/app-crypt/ekeyd/files/ekey-ulusbd.init.2 @@ -0,0 +1,40 @@ +#!/sbin/openrc-run +# Copyright 2009-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +INSTANCE="${SVCNAME#*.}" +if [ -z "${INSTANCE}" -o "${SVCNAME}" = "ekey-ulusbd" ]; then + INSTANCE="ekey-ulusbd" +fi + +: ${SOCKET_PATH:=/var/run/ekey-ulusbd-${EKEY_SERIAL}} + +description="EntropyKey Userland USB Daemon" + +pidfile=/var/run/$SVCNAME.pid +command=/usr/libexec/ekey-ulusbd +command_args="-P ${pidfile} -p ${SOCKET_PATH}" + +depend() { + need localmount +} + +start() { + if [ -z ${USB_BUS} ]; then + set -- $(lsusb -v -d 20df:0001 | \ + egrep '(^Bus|iSerial)' | \ + grep -B1 "${EKEY_SERIAL}" | \ + head -n 1 | \ + cut -c 5-7,15-18) + USB_BUS=$1 + USB_DEV=$2 + fi + + ebegin "Starting ${description}" + start-stop-daemon \ + --start --pidfile ${pidfile} \ + --exec ${command} -- \ + ${command_args} \ + -b $(printf %03d ${USB_BUS}) -d $(printf %03d ${USB_DEV}) -D + eend $? +} |