From: Dimitris Aragiorgis Date: Tue, 4 Mar 2014 16:48:53 +0000 (+0200) Subject: Log table's uplink only if exists X-Git-Url: https://code.grnet.gr/git/snf-network/commitdiff_plain/cc09dec121c89f8a50998c8e3e864f31a308f21a Log table's uplink only if exists Signed-off-by: Dimitris Aragiorgis --- diff --git a/common.sh b/common.sh index 0c96dc6..ac8e279 100755 --- a/common.sh +++ b/common.sh @@ -213,7 +213,9 @@ function get_uplink { local table=$1 UPLINK=$(ip route list table $table | grep "default via" | awk '{print $5}') UPLINK6=$(ip -6 route list table $table | grep "default via" | awk '{print $5}') - $SNF_NETWORK_LOG $0 "* Table $table: uplink -> $UPLINK, uplink6 -> $UPLINK6" + if [ -n "$UPLINK" -o -n "$UPLINK6" ]; then + $SNF_NETWORK_LOG $0 "* Table $table: uplink -> $UPLINK, uplink6 -> $UPLINK6" + fi }