Re: Check whether an IPSET already exists?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 19 Nov 2008, Jozsef Kadlecsik wrote:

> # Check that an existing set is empty:
> if [ -z "`ipset -L foo 2>/dev/null | \
> 	  awk '{ if (FNR == 7) print $0 }'| \
> 	  grep Bindings:`" ]; then
> 	echo "Set foo is empty."
> fi

The test should be inverted to check that the set is empty, i.e.
"if [ -n ..."

Best regards,
Jozsef
-
E-mail  : kadlec@xxxxxxxxxxxxxxxxx, kadlec@xxxxxxxxxxxx
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : KFKI Research Institute for Particle and Nuclear Physics
          H-1525 Budapest 114, POB. 49, Hungary
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux