This is the command uhome that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator
PROGRAM:
NAME
uhome - tests whether or not you're home, based on device presence
SYNOPSIS
uhome [-f|--file FILE] [-q|--quiet] [-t|--tries TRIES]
OPTIONS
-f, --file FILE filename containing list of IP addresses to test, one per line,
default is ~/.uhome/addresses
-q, --quiet Suppress all output
-t, --tries TRIES Number of times to ping each IP address, default is 3
DESCRIPTION
This utility will iterate over a list of IP addresses in FILE (default
~/.uhome/addresses), and ping(8) each one of them up to TRIES times. If any one of those
responds successfully, then you're deemed "home" and uhome exits successfully, with 0.
Otherwise, you must not be home, and uhome exits with 1.
EXAMPLES
Look up your phone's IP address, either on your router, or in your Phone -> Settings ->
About Phone -> Status -> IP Address.
Add one or more of these to ~/.uhome/addresses.
Run:
$ uhome
uhome → Yep!
$ uhome
uhome → Nope!
Couple this with some logic:
$ uhome && nest-home || nest-away
Put this in a cronjob:
*/5 * * * * uhome && nest-home || nest-away
Use uhome online using onworks.net services