Created
October 2, 2014 16:24
-
-
Save mpenick/12f074bf3ec990976ca2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/bash | |
while true | |
do | |
r=$(( ( RANDOM % 100 ) + 1 )) | |
if [[ "$r" -gt "0" && "$r" -lt "11" ]]; then | |
echo "dropping 192.168.1.112" | |
iptables -A INPUT -d 192.168.1.112 -p tcp --destination-port 9042 -j DROP | |
elif [[ "$r" -gt "10" && "$r" -lt "21" ]]; then | |
echo "dropping 192.168.1.113" | |
iptables -A INPUT -d 192.168.1.113 -p tcp --destination-port 9042 -j DROP | |
else | |
echo "flushing" | |
iptables -F | |
fi | |
s=$(( ( RANDOM % 30 ) + 1 )) | |
echo "sleeping for $s" | |
sleep $s | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment