From 35553e0102a8df00251ee052f201a2d2f5320a3f Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Wed, 20 Oct 2021 21:11:59 +0200 Subject: nhrp: T3922: ignore error when deleting non existing iptables rule --- scripts/vyos-update-nhrp.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/vyos-update-nhrp.pl b/scripts/vyos-update-nhrp.pl index 35c423c..2442bea 100644 --- a/scripts/vyos-update-nhrp.pl +++ b/scripts/vyos-update-nhrp.pl @@ -454,9 +454,9 @@ sub ipsec_config { sub create_nhrp_iptables { my $config_tun = new Vyatta::Config; - + $config_tun->setLevel("interfaces tunnel"); - + if ( $config_tun->exists("$tun local-ip")) { if ( $config_tun->exists("$tun remote-ip")) { print ("$tun is not 'mGRE' tunnel'\n"); @@ -472,10 +472,10 @@ sub create_nhrp_iptables { } sub delete_nhrp_iptables { - system ("sudo iptables -D OUTPUT -j VYOS_NHRP_${tun}_OUT_HOOK") == 0 or die "System call failed: $!"; - system ("sudo iptables -D VYOS_NHRP_${tun}_OUT_HOOK 1") == 0 or die "System call failed: $!"; - system ("sudo iptables -D VYOS_NHRP_${tun}_OUT_HOOK 1") == 0 or die "System call failed: $!"; - system ("sudo iptables -X VYOS_NHRP_${tun}_OUT_HOOK") == 0 or die "System call failed: $!"; + system ("sudo iptables -D OUTPUT -j VYOS_NHRP_${tun}_OUT_HOOK >/dev/null 2>&1"); + system ("sudo iptables -D VYOS_NHRP_${tun}_OUT_HOOK 1 >/dev/null 2>&1"); + system ("sudo iptables -D VYOS_NHRP_${tun}_OUT_HOOK 1 >/dev/null 2>&1"); + system ("sudo iptables -X VYOS_NHRP_${tun}_OUT_HOOK >/dev/null 2>&1"); } # -- cgit v1.2.3