Hamw.
i modified the script to use local (lan) addresses as you did my script works fine on both phones.
Feb 16, 2011 7:07:41 AM
Time/Date Action Location Detection via WiFi
Script Marion's iPhone wasn't detected - will try to wake it up
Script Ham is Home
Time/Date Action Location Detection via WiFi
Script Marion is Home
Feb 16, 2011 7:08:13 AM
Time/Date Action Location Detection via WiFi
Script Marion is Home
Feb 16, 2011 7:08:37 AM
Time/Date Action Location Detection via WiFi
Script Marion is Home
with timeout of 10 seconds
try
(do shell script "/sbin/ping -o -t 4 -c 4 google.com")
on error errStatement number errNum --errStatement holds text of error message, errNum the integer code described in either 'man ping' or sysexits.h
tell application "IndigoServer"
turn off device "Router"
log "Internet Connection Lost - Rebooting Router"
delay 5
turn on device "Router"
set value of variable "Router_Last_Reboot" to (current date) as string
end tell
end try
end timeout
16Feb, 2011 11:25:14 PM
Time/Date Action Location Detection via WiFi
Script Marion is Home
Script Ham is Home
Script Marion is Home
Script Ham is Away --No, was at home with phone right next to me
16Feb, 2011 11:27:31 PM
Script Marion is Home
Script Ham's iPhone wasn't detected - will try to wake it up
Script Marion is Home
Script Ham is Home --Correct.
#!/bin/bash
ssh root@192.168.xxx.xxx 'arp -a' >whoshome.tmp
if grep -q device1 whoshome.tmp; then
curl -X PUT -d value=home http://127.0.0.1:8176/variables/homePerson1
else
curl -X PUT -d value=away http://127.0.0.1:8176/variables/homePerson1
fi
if grep -q device2 whoshome.tmp; then
curl -X PUT -d value=home http://127.0.0.1:8176/variables/homePerson2
else
curl -X PUT -d value=away http://127.0.0.1:8176/variables/homePerson2
fi
if grep -q device3 whoshome.tmp; then
curl -X PUT -d value=home http://127.0.0.1:8176/variables/homePerson3
else
curl -X PUT -d value=away http://127.0.0.1:8176/variables/homePerson3
fi
rm whoshome.tmp
sudo crontab -e
*/5 * * * * /Users/user123/scripts/whoshome.sh >/dev/null
chmod +x whoshome.sh
Users browsing this forum: No registered users and 1 guest