run script when 1) internet is connected 2) login/logout/wake 4) some app is launched

Joined
Oct 21, 2009
Messages
4
Reaction score
0
Points
1
Hello,

To track my computer in case my laptop is stolen, I am currently running a bash script to send hostname, ip, and cam capture image to my email every 5 minutes using cron.

I believe this helps when I lose my laptop, but I want to send an email not only in timed manner but also in some critical incidents.

i am thinking three cases:

1) internet is connected
2) login/logout/wakeup
3) some app (safari, etc) is launched.

I searched web, and found this:
2c) wakeup case can be done by SleepWatcher

However, I couldn't find other cases, and i prefer non-daemon approach (sleepwatcher will definitely use some memory.). I hope that i can do it with scripting languages, such as applescript or bash script. Please let me know if you know any of three cases.

Thank you.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top