[auth] Improves yubikey handling

This commit is contained in:
Nemo 2016-12-21 17:18:37 +05:30
parent 50a776ff77
commit ea4dfa09ce
2 changed files with 5 additions and 2 deletions

View File

@ -4,7 +4,7 @@ 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
if [[ "$YUBIKEY_SERIAL" -eq "$DEVICE_SERIAL" ]]; then
echo "`date` unlocked using yubkikey" >> $LOGFILE
killall i3lock
fi

View File

@ -1,3 +1,6 @@
#!/bin/bash
/bin/su nemo -c "DISPLAY=:0 xautolock -locknow"
LOGFILE="/home/nemo/logs/auth.log"
/bin/su nemo -c "DISPLAY=:0 /home/nemo/projects/scripts/i3lock.sh" >> $LOGFILE
echo "`date` locked using Yubikey $?" >> $LOGFILE