From 190a9e9245f0456a09cbf88a5a5a2b60886517ca Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 8 Dec 2021 09:07:16 -0500 Subject: [PATCH] TT#14008 allow null TABLE variable If there's no config file present then retrieval of the table number yields an empty string. Allow this as an expected case to silence a warning from bash (using -lt against an empty string) Change-Id: I0420d2e1c555f6b56a56fc5f47d3bc183a929e50 --- debian/ngcp-rtpengine-iptables-setup | 4 ++-- pkg/deb/debian/rtpengine-iptables-setup | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/ngcp-rtpengine-iptables-setup b/debian/ngcp-rtpengine-iptables-setup index 56cf87e38..3b9045db7 100755 --- a/debian/ngcp-rtpengine-iptables-setup +++ b/debian/ngcp-rtpengine-iptables-setup @@ -39,7 +39,7 @@ fi firewall_setup() { - if [ "$TABLE" -lt 0 ] || [ "$VIRT" = "yes" ]; then + if [ -z "$TABLE" ] || [ "$TABLE" -lt 0 ] || [ "$VIRT" = "yes" ]; then return fi @@ -66,7 +66,7 @@ firewall_setup() firewall_teardown() { - if [ "$TABLE" -lt 0 ] || [ "$VIRT" = "yes" ]; then + if [ -z "$TABLE" ] || [ "$TABLE" -lt 0 ] || [ "$VIRT" = "yes" ]; then return fi diff --git a/pkg/deb/debian/rtpengine-iptables-setup b/pkg/deb/debian/rtpengine-iptables-setup index b024212ce..1c4363462 100755 --- a/pkg/deb/debian/rtpengine-iptables-setup +++ b/pkg/deb/debian/rtpengine-iptables-setup @@ -39,7 +39,7 @@ fi firewall_setup() { - if [ "$TABLE" -lt 0 ] || [ "$VIRT" = "yes" ]; then + if [ -z "$TABLE" ] || [ "$TABLE" -lt 0 ] || [ "$VIRT" = "yes" ]; then return fi @@ -66,7 +66,7 @@ firewall_setup() firewall_teardown() { - if [ "$TABLE" -lt 0 ] || [ "$VIRT" = "yes" ]; then + if [ -z "$TABLE" ] || [ "$TABLE" -lt 0 ] || [ "$VIRT" = "yes" ]; then return fi