Skip to content

Instantly share code, notes, and snippets.

@cuibonobo
Created July 20, 2013 16:23
Show Gist options
  • Save cuibonobo/6045614 to your computer and use it in GitHub Desktop.
Save cuibonobo/6045614 to your computer and use it in GitHub Desktop.
Detect if there is someone remotely viewing your computer. (Taken from http://apple.stackexchange.com/questions/15945/application-to-notify-user-of-active-vnc-connection)
#!/bin/bash
alertme() {
say "Big brother watching"
# If you want a Growl notification:
# growlnotify --appIcon TextEdit "Big brother" -m 'watching'
}
while :
do
netstat -a | grep vnc | grep ESTABLISHED && alertme
sleep 60 #wait 60 seconds
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment