-
-
Save fasaxc/ee443a9ef82ce2e4dab059161f095ec2 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
failed=false | |
function felix () { | |
while true; do | |
echo -n a | |
iptables-restore --noflush --verbose <<EOF | |
*filter | |
:felix - | |
--append felix -m comment --comment "FELIX-A" | |
COMMIT | |
EOF | |
echo -n A | |
echo -n b | |
iptables-restore --noflush --verbose <<EOF | |
*filter | |
:felix - | |
--append felix -m comment --comment "FELIX-B" | |
COMMIT | |
EOF | |
echo -n B | |
if iptables-save | grep -q FELIX-A; then | |
echo | |
echo "FELIX-B update was clobbered" | |
failed=true | |
return 1 | |
fi | |
echo -n C | |
done | |
} | |
function kube () { | |
while ! ${failed}; do | |
echo -n k | |
iptables-restore --noflush --verbose <<EOF | |
*filter | |
:kube - | |
COMMIT | |
EOF | |
echo -n K | |
done | |
} | |
kube & | |
kube_pid=$! | |
felix; kill $kube_pid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment