Skip to content

Instantly share code, notes, and snippets.

@sideup66
Created June 16, 2022 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sideup66/063ad1aecd65c1d3363afa53d586b50b to your computer and use it in GitHub Desktop.
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.
#!/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