1 2 3 4 5 6 7 8 9 10 11 12
#!/bin/bash set -e $IPTABLES -N c1 $IPTABLES -N c2 $IPTABLES -E c1 c2 if [ $? -eq 0 ] ; then echo "E: Renamed with existing chain" >&2 exit 0 fi