Skip to content

Instantly share code, notes, and snippets.

@bernerdschaefer
Created June 5, 2013 15:25
Show Gist options
  • Save bernerdschaefer/5714719 to your computer and use it in GitHub Desktop.
Save bernerdschaefer/5714719 to your computer and use it in GitHub Desktop.
#!/usr/bin/bash
set -e
echo "starting doozer:8046"
doozerd -timeout 10 -hist 100 -l "127.0.0.1:8046" -w ":8080" -c test &>tmp/8046.log &
sleep 1
echo "starting doozer:8047"
doozerd -timeout 10 -hist 100 -l "127.0.0.1:8047" -w false -b "doozer:?ca=127.0.0.1:8046" -c test &>tmp/8047.log &
sleep 1
echo "starting doozer:8048"
doozerd -timeout 10 -hist 100 -l "127.0.0.1:8048" -w false -b "doozer:?ca=127.0.0.1:8046" -c test &>tmp/8048.log &
sleep 1
echo -n | doozer add /ctl/cal/1
echo -n | doozer add /ctl/cal/2
sleep 1
PORT=8048
trap "sudo iptables -D INPUT --proto udp --dport $PORT -j DROP &>/dev/null" EXIT
echo "blocking UDP packets on port $PORT"
sudo iptables -I INPUT --proto udp --dport $PORT -j DROP
echo "filling history"
for i in {0..100}
do
printf $i | doozer set "/incr" -1 >/dev/null
done
echo "unblocking UDP packets on port $PORT"
sudo iptables -D INPUT --proto udp --dport $PORT -j DROP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment