From f4009c39d85f9bc8b89b51203c3c7e7fcbfd32d0 Mon Sep 17 00:00:00 2001 From: Nesc58 Date: Tue, 28 Jul 2020 10:45:03 +0200 Subject: [PATCH] wait added to iptables commands --- prog/weave-kube/launch.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/prog/weave-kube/launch.sh b/prog/weave-kube/launch.sh index 0de63126..d6e68a1e 100755 --- a/prog/weave-kube/launch.sh +++ b/prog/weave-kube/launch.sh @@ -37,17 +37,17 @@ setup_iptables_backend() { # Check whether xt_set actually exists xt_set_exists() { # Clean everything up in advance, in case there's leftovers - iptables -F WEAVE-KUBE-TEST 2>/dev/null || true - iptables -X WEAVE-KUBE-TEST 2>/dev/null || true + iptables -w -F WEAVE-KUBE-TEST 2>/dev/null || true + iptables -w -X WEAVE-KUBE-TEST 2>/dev/null || true ipset destroy weave-kube-test 2>/dev/null || true ipset create weave-kube-test hash:ip - iptables -t filter -N WEAVE-KUBE-TEST - if ! iptables -A WEAVE-KUBE-TEST -m set --match-set weave-kube-test src -j DROP; then + iptables -w -t filter -N WEAVE-KUBE-TEST + if ! iptables -w -A WEAVE-KUBE-TEST -m set --match-set weave-kube-test src -j DROP; then NOT_EXIST=1 fi - iptables -F WEAVE-KUBE-TEST - iptables -X WEAVE-KUBE-TEST + iptables -w -F WEAVE-KUBE-TEST + iptables -w -X WEAVE-KUBE-TEST ipset destroy weave-kube-test [ -z "$NOT_EXIST" ] || (echo "\"xt_set\" does not exist" >&2 && return 1) }