diff --git a/yubi-insert.sh b/yubi-insert.sh new file mode 100755 index 0000000..cce14d4 --- /dev/null +++ b/yubi-insert.sh @@ -0,0 +1,10 @@ +#!/bin/bash +YUBIKEY_SERIAL=`cat /home/nemo/.yubikey-serial.txt` +DEVICE_SERIAL=`ykinfo -s | cut -d ' ' -f 2` +LOGFILE="/home/nemo/logs/auth.log" + +# We only unlock the device if the key matches +if [[ "$YUBIKEY_SERIAL"="$DEVICE_SERIAL" ]]; then + echo "`date` unlocked using yubkikey" >> $LOGFILE + killall i3lock +fi \ No newline at end of file