Otherwise If I run the script from the command line the detection is correct. It results in ‘Phone detected’ although I am not connected to the network. The log contains just the last ‘Try’ entry but it is never achieving the command ‘echo off’.Īlso the script is not running correct. I am not sure but I assume that the script is not running up to the last line of code if it is not finding a phone. # Output-Parameter: 1 = ip-device deteced, 0 = not detected # wait time between the pings: a random number of 1 - 10 secs (would probably work if you fix the sleep to 10 secs as well) # script will try to reach ip address 30 times (hping3 not always 'wakes up' the iphone) Script to detect iphone “detect_ip.pl”: #!/usr/bin/perl -w Select the model of the keyboard or just leave it to the default. I use 4 cron scripts in parallel (every 5 minutes) to detect presence of the 4 phones in my household, each cron-script invoking the below’s perl script and depending on the result triggers an openhab-rest-api to set a switch… Tags: beginners, centos 6.5 ISO install, how to, minimal mode, text mode installation, tutorial, virtual box, windows 7, windows 8.1 4 I have just installed CentOS 6.5 (minimal) in Virtual Box on my Windows 8.1 pc.
I am sure the script can be improved (I am not exactly a perl expert), but it works fine for me. I chose perl to implement the above concept on a Raspi2. I am really thankful for this thread (surprisingly it seems that there is not much discussion going on in the web at all about this topic) as it seems to be the only way that works in a stable manner.