Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- kb="/dev/input/by-path/platform-i8042-serio-0-event-kbd" #keyboard device
- logfile="/tmp/bs.log"
- #start loggin keystrokes
- cat "$kb" | od -i > "$logfile" &
- while [ 1 ]
- do
- #Get number of times BackSpace has been pressed
- let x="$(tail -n 600 "$logfile"|awk '{print $5}'|grep "^14$"|wc -l)"
- echo "Check keystroke log."
- if [ "$x" -gt "20" ]
- then
- echo "BackSpace has been press to many times in the last 100 keystrokes"
- echo "Are you Drunk?"|wall
- sleep 1m
- fi
- sleep 10
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement