summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-10-20 21:11:59 +0200
committerChristian Poessinger <christian@poessinger.com>2021-10-20 21:11:59 +0200
commit35553e0102a8df00251ee052f201a2d2f5320a3f (patch)
treecff3350d3e149eff9a3fca8dcb297dabec6c7376
parent0a836311e4f12ed74bd6cb0cc10677ceae8c8a47 (diff)
downloadvyos-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.pl12
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");
}
#