diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-10-20 21:11:59 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-10-20 21:11:59 +0200 |
commit | 35553e0102a8df00251ee052f201a2d2f5320a3f (patch) | |
tree | cff3350d3e149eff9a3fca8dcb297dabec6c7376 | |
parent | 0a836311e4f12ed74bd6cb0cc10677ceae8c8a47 (diff) | |
download | vyos-nhrp-35553e0102a8df00251ee052f201a2d2f5320a3f.tar.gz vyos-nhrp-35553e0102a8df00251ee052f201a2d2f5320a3f.zip |
nhrp: T3922: ignore error when deleting non existing iptables rule
-rw-r--r-- | scripts/vyos-update-nhrp.pl | 12 |
1 files 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"); } # |