Stop errors when displaying an empty routing table

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2024-02-28 15:20:25 -08:00
parent b8581e54fa
commit 1377fc8897

View File

@ -649,9 +649,9 @@ show_routing() {
ip -$g_family rule list | find_tables | sort -u | while read table; do ip -$g_family rule list | find_tables | sort -u | while read table; do
heading "Table $table:" heading "Table $table:"
if [ $g_family -eq 6 ]; then if [ $g_family -eq 6 ]; then
ip -6 -o route list table $table | grep -vF cache | sort_routes ip -6 -o route list table $table 2>/dev/null | grep -vF cache | sort_routes
else else
ip -4 -o route list table $table | sort_routes ip -4 -o route list table $table 2>/dev/null | sort_routes
fi fi
done done