Created
June 16, 2022 00:19
-
-
Save sideup66/063ad1aecd65c1d3363afa53d586b50b to your computer and use it in GitHub Desktop.
Little script I wrote to monitor my wyzecam to detect if it trips its flooding condition. Replace <camera ip here> with your camera's ip and <reboot command here> with your ssh or iftt command.
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
#!/bin/sh | |
while true | |
do | |
if [ $(cat /proc/net/ip_conntrack | grep -c <camera ip here>) -gt 5000 ]; then | |
echo "Camera may be flooding the network, kicking device" | |
echo "Rebooting Camera" | |
<reboot command here> | |
echo "sleeping for 1 minute to allow connections to clear" | |
sleep 60 | |
else | |
echo "Camera is behaving for the moment....nothing to do" | |
fi | |
sleep 10 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment