2016-07-18 12:42:25 +00:00
|
|
|
#!/bin/bash
|
|
|
|
YUBIKEY_SERIAL=`cat /home/nemo/.yubikey-serial.txt`
|
|
|
|
DEVICE_SERIAL=`ykinfo -s | cut -d ' ' -f 2`
|
|
|
|
LOGFILE="/home/nemo/logs/auth.log"
|
|
|
|
|
2017-01-31 14:26:47 +00:00
|
|
|
export DISPLAY=:0
|
|
|
|
|
2016-07-18 12:42:25 +00:00
|
|
|
# We only unlock the device if the key matches
|
2016-12-21 11:48:37 +00:00
|
|
|
if [[ "$YUBIKEY_SERIAL" -eq "$DEVICE_SERIAL" ]]; then
|
2016-07-18 12:42:25 +00:00
|
|
|
echo "`date` unlocked using yubkikey" >> $LOGFILE
|
2017-06-30 18:27:52 +00:00
|
|
|
xautolock -unlocknow
|
2016-07-18 12:42:25 +00:00
|
|
|
fi
|