Created
July 23, 2021 18:13
-
-
Save sideup66/dcbde12b8bc751f1e0e4705a67bc63f3 to your computer and use it in GitHub Desktop.
performs a simple pingcheck to see if a device is on the network or not. if not, turns on my iot away.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#this is a simple pingscript for my Wyze camera. It unfortunately has a flawed scheduling system where if i leave my house and turn on its | |
#motion detection, then a schedule for detection runs, if I am not home before the schedule ends, motion sensing will turn off. | |
#I use this script to determine if I am home by pinging my cellphone, if so, allow sensing to shut off, if not, turn it back on. | |
#Replace <dev_hostname> with your device's IP or hostname | |
#!/bin/sh | |
ping -c1 <dev_hostname> > /dev/null | |
if [ $? -eq 0 ] | |
then | |
echo "home, not turning on camera" | |
exit 0 | |
else | |
echo âturning on cameraâ | |
<run your IoT commands here> | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment