1
0
mirror of https://github.com/captn3m0/Scripts.git synced 2024-09-27 22:22:53 +00:00
scripts/yubi-insert.sh
2017-06-30 23:57:52 +05:30

12 lines
339 B
Bash
Executable File

#!/bin/bash
YUBIKEY_SERIAL=`cat /home/nemo/.yubikey-serial.txt`
DEVICE_SERIAL=`ykinfo -s | cut -d ' ' -f 2`
LOGFILE="/home/nemo/logs/auth.log"
export DISPLAY=:0
# We only unlock the device if the key matches
if [[ "$YUBIKEY_SERIAL" -eq "$DEVICE_SERIAL" ]]; then
echo "`date` unlocked using yubkikey" >> $LOGFILE
xautolock -unlocknow
fi