Ensure at least one CIDR is supplied to multi-CIDR commands

This commit is contained in:
Adam Harrison committed 2015-04-17 11:38:46 +01:00
1 parent f17cd6ac3b
commit be05cec1b0
1 file changed
+3
+3
View File
@@ -147,6 +147,9 @@ collect_cidr_args() {
CIDR_COUNT=$(($CIDR_COUNT + 1))
shift 1
done
if [ $CIDR_COUNT -eq 0 ]; then
[ $# -gt 0 ] && validate_cidr "$1" || usage
fi
}
run_iptables() {