From dd0d53927eb8aba222ac9cc98032bf9f583543bf Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Mon, 27 Nov 2017 15:20:56 -0500 Subject: [PATCH] ykman Signed-off-by: Jess Frazelle --- ykman/Dockerfile | 6 ++++++ ykman/entrypoint.sh | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100755 ykman/entrypoint.sh diff --git a/ykman/Dockerfile b/ykman/Dockerfile index 7a50108..6d1c253 100644 --- a/ykman/Dockerfile +++ b/ykman/Dockerfile @@ -10,6 +10,7 @@ FROM ubuntu:16.04 LABEL maintainer "Jessie Frazelle " RUN apt-get update && apt-get install -y \ + pcscd \ software-properties-common \ --no-install-recommends && \ add-apt-repository ppa:yubico/stable && \ @@ -17,6 +18,11 @@ RUN apt-get update && apt-get install -y \ yubikey-manager \ && rm -rf /var/lib/apt/lists/* +ENV LC_ALL=C.UTF-8 LANG=C.UTF-8 + WORKDIR /root/ +COPY entrypoint.sh /usr/local/bin/ + +ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ] CMD [ "ykman", "--help" ] diff --git a/ykman/entrypoint.sh b/ykman/entrypoint.sh new file mode 100755 index 0000000..fe72a9d --- /dev/null +++ b/ykman/entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -e +set -o pipefail + +init(){ + local pcscd_running=$(ps -aux | grep [p]cscd) + if [ -z "$pcscd_running" ]; then + echo "starting pcscd in backgroud" + pcscd --debug --apdu + pcscd --hotplug + else + echo "pcscd is running in already: ${pcscd_running}" + fi +} + +init + +"$@"