#!/bin/sh # (C) 2016 by Christian Hesse # # This software may be used and distributed according to the terms # of the GNU General Public License, incorporated herein by reference. YKFDEFACTOR="$(systemd-ask-password --no-tty 'Please enter second factor for Yubikey full disk encryption!')" YKFDESERIAL="$(keyctl 'add' 'user' 'ykfde-2f' "${YKFDEFACTOR}" '@u')" keyctl 'timeout' "${YKFDESERIAL}" '150' if [ -s '/run/ykfde.pid' ]; then kill -USR1 $(cat '/run/ykfde.pid') # ykfde started from udev needs a moment to set up the key # in store. It is out of systemd control, so wait a moment # here. sleep 0.2 fi true