<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>crontasks/read_mission_statement.cron</filename>
    </added>
    <added>
      <filename>crontasks/saved_crontab.txt</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -10,7 +10,7 @@
 # Debug mode just means provide any cmd lne argument
 DEBUG=$1
 
-# My Location Storing File
+# Files
 LOCATION_FILE='/Users/joe/.location'
 
 # My Location thanks to outside scripts
@@ -41,6 +41,7 @@ elif [ &quot;$LOCATION&quot; = &quot;rit&quot; ]; then
 
 # Default
 else
-	[ -n &quot;$DEBUG&quot; ] &amp;&amp; echo '@Unknown'
-	/usr/bin/osascript -e 'tell application &quot;Adium&quot; to go online with message &quot;@Unknown&quot;'	
+	[ -n &quot;$DEBUG&quot; ] &amp;&amp; echo &quot;@$LOCATION&quot;
+	/usr/bin/osascript -e &quot;tell application \&quot;Adium\&quot; to go online with message \&quot;@$LOCATION\&quot;&quot;
+	# /usr/bin/osascript -e 'tell application &quot;Adium&quot; to go online with message &quot;@Unknown&quot;'	
 fi
\ No newline at end of file</diff>
      <filename>crontasks/update_adium_status.cron</filename>
    </modified>
    <modified>
      <diff>@@ -10,8 +10,23 @@
 # Debug mode just means provide any cmd-line argument
 DEBUG=$1
 
-# My Location Storing File
+# My Location Storing File and other Setup Details
 LOCATION_FILE='/Users/joe/.location'
+LOCATION_LOCK_FILE='/Users/joe/.location_lock'
+NOW=`/usr/bin/ruby -e 'puts Time.now.to_i'`
+IP=`curl --silent --connect-timeout 2 www.whatismyip.com/automation/n09230945.asp`
+
+# Lock File Exists, Either Delete it if its old or leave everything alone
+if [ -e &quot;$LOCATION_LOCK_FILE&quot; ]; then
+	LOCK_UNTIL=`/bin/cat $LOCATION_LOCK_FILE`
+	if [ $LOCK_UNTIL -lt $NOW ]; then
+		[ -n &quot;$DEBUG&quot; ] &amp;&amp; echo &quot;Lock File is old. Removing and moving on.&quot;
+		/bin/rm -f $LOCATION_LOCK_FILE
+	else
+		[ -n &quot;$DEBUG&quot; ] &amp;&amp; echo &quot;Lock Exists and is valid.&quot;
+		exit 0
+	fi
+fi
 
 # Used for School comparison
 day_hour=`/bin/date +&quot;%A %H&quot;`
@@ -25,12 +40,22 @@ if [ -n &quot;$(/usr/sbin/arp -a | /usr/bin/grep 0:1e:2a:76:17:98)&quot; ]; then
 elif [ -n &quot;`echo {Monday\ {12,13,16,17},Wednesday\ {12,13,16,17}} | /usr/bin/grep \&quot;$day_hour\&quot;`&quot; ]; then
 	[ -n &quot;$DEBUG&quot; ] &amp;&amp; echo 'class'
 	echo &quot;class&quot; &gt; $LOCATION_FILE
+	
+# Not Connected to the Internet, no IP Address
+elif [ -z &quot;$IP&quot; ]; then
+	[ -n &quot;$DEBUG&quot; ] &amp;&amp; echo 'Not Connected to the Internet' &amp;&amp; echo 'noip'
+	echo &quot;noip&quot; &gt; $LOCATION_FILE
 
 # RIT Hostname should only exist when at rit
+elif [ &quot;jpecoraro.rit.edu&quot; = &quot;$(nslookup $IP | awk '/name =/{print substr($4,1,length($4)-1)}')&quot; ]; then
+	[ -n &quot;$DEBUG&quot; ] &amp;&amp; echo 'rit'
+	echo &quot;rit&quot; &gt; $LOCATION_FILE
+
+# RIT Hostname attempt number two, the above is cleaner though
 elif [ &quot;0 packets received&quot; != &quot;$(/sbin/ping -c 1 -t 2 jpecoraro.rit.edu 2&gt; /dev/null \
-                                    | cat - &lt;(echo '0 packets received')              \
-                                    | grep -E -o '[0-9]+ packets received'            \
-                                    | head -1)&quot; ]; then
+                                    | /bin/cat - &lt;(echo '0 packets received')         \
+                                    | /usr/bin/grep -E -o '[0-9]+ packets received'   \
+                                    | /usr/bin/head -1)&quot; ]; then
 	[ -n &quot;$DEBUG&quot; ] &amp;&amp; echo 'rit'
 	echo &quot;rit&quot; &gt; $LOCATION_FILE
 </diff>
      <filename>crontasks/update_location.cron</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9ac9aec350be03ea7ab2f2ed28b50bb1f6a96037</id>
    </parent>
  </parents>
  <author>
    <name>Joseph Pecoraro</name>
    <email>joepeck02@gmail.com</email>
  </author>
  <url>http://github.com/JosephPecoraro/scripts/commit/8a6fdf0c030f1fa45c87499da3186e88cabb9896</url>
  <id>8a6fdf0c030f1fa45c87499da3186e88cabb9896</id>
  <committed-date>2009-04-14T22:53:47-07:00</committed-date>
  <authored-date>2009-04-14T22:53:47-07:00</authored-date>
  <message>Settled on location based cron tasks.</message>
  <tree>6f9ddc8df4066d5ebf788ecfaf416db59d6f8d2f</tree>
  <committer>
    <name>Joseph Pecoraro</name>
    <email>joepeck02@gmail.com</email>
  </committer>
</commit>
