shell scripts

An AppleScript/Bash combination to annoy theifs

So here's a combination shell script/launch daemon/AppleScript that, if computer is stolen, puts a sticky growl notification on the screen (every two seconds...repeatedly...filling the entire screen eventually) with your name and phone number, offering a cash reward if computer is stolen.

First here's the AppleScript, which I have saved under /etc/.stolen/StolenGrowlNotifier.scpt:

Read more...

com.jacobbraun.five.isstolen.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.jacobbraun.five.isstolen</string>
<key>OnDemand</key>
<true/>
<key>StartInterval</key>
<integer>360</integer>
<key>ProgramArguments</key>
<array>
<string>/private/etc/.stolen/isstolen.sh</string>
</array>
</dict>
</plist>

phonehome.sh

#!/bin/bash

## Written by Jacob Braun, http://five.jacobbraun.com

## These should be pretty self explanatory
username=yourusername
password=yourpassword
server=yourftpserver
returnfile=phonehome
website="http://yourwebsite/"$returnfile
## No leading or trailing slashes on remotepath
remotepath=no/leading/or/trailing/slashes

## A simple test for internet access. If no internet access found, or the file is unavailable, pause for 20 seconds then check again.
site=`(curl -s $website)`
if [ "$site" != "true" ]; then
        sleep 20;
fi;

## Check internet access again.
Read more...

sayit.sh

#!/bin/bash

## Written by Jacob Braun, http://five.jacobbraun.com

sayit=`grep true /etc/sayit`

## If $sayit is found to be true, then all hell breaks lose.

while [ $sayit == "true" ]; do
        COUNTER=0
        while [ $COUNTER -lt 10 ]; do
                osascript -e 'set volume 7'
                say -v Victoria "This computer has been stolen from Your Name. Please call **phone number** to return computer for cash reward, no questions asked."
                sleep 2
                let COUNTER=COUNTER+1
        done
        sayit=`grep true /etc/sayit`
done
exit 0

growlit.sh

#!/bin/bash

## Written by Jacob Braun, http://five.jacobbraun.com

growlit=`grep true /etc/growlit`

## If $growlit is found to be true, then all hell breaks lose.

while [ $growlit == "true" ]; do
        COUNTER=0
        while [ $COUNTER -lt 10 ]; do
                osascript /etc/.stolen/StolenGrowlNotifier.scpt
                sleep 2
                let COUNTER=COUNTER+1
        done
        growlit=`grep true /etc/growlit`
done
exit 0

isstolen.sh

#!/bin/bash

## Written by Jacob Braun, http://five.jacobbraun.com

file=`grep false /etc/isstolen`
website=http://yoururl/phonehome

sleep 30;
phonehome=`(curl -s $website)`

if [ "$file" == "false" ]; then
        if [ "$phonehome" == "true" ]; then
                rm -rf /etc/isstolen
                /opt/local/bin/wget -P /etc http://yoururl/isstolen
                rm -rf /etc/sayit
                /opt/local/bin/wget -P /etc http://yoururl/sayit
                rm -rf /etc/growlit
                /opt/local/bin/wget -P /etc http://yoururl/growlit
                touch /etc/isstolen
                touch /etc/sayit
                touch /etc/growlit
        fi;
fi;
exit 0

StolenGrowlNotifier.scpt

tell application "GrowlHelperApp"
        set the allNotificationsList to ¬
                {"Stolen"}
       
        set the enabledNotificationsList to ¬
                {"Stolen"}
       
        register as application ¬
                "Stolen Mac" all notifications allNotificationsList ¬
                default notifications enabledNotificationsList ¬
               
        notify with name ¬
                "Stolen" title ¬
                "This computer has been stolen." description ¬
                "Please call *phonenumber* for no questions asked cash reward." application name ¬
                "Stolen Mac" icon of file "file:///etc/.stolen/apple-lock-icon.icns" priority 2 with sticky
end tell
Syndicate content