From 42ab70c32a767273425f2f4c95076e31d3f94eed Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 5 Mar 2021 17:06:50 +0100 Subject: [PATCH] Log 'ip route show table' errors to corresponding error file We are iterating over the defined tables in /etc/iproute2/rt_tables, though for tables that don't exist, ip reports an ugly error message, that's a bit confusing during execution within grml-hwinfo: | root@grml ~ # grep -v '^#' /etc/iproute2/rt_tables | 255 local | 254 main | 253 default | 0 unspec | root@grml ~ # ip route show table 253 | Error: ipv4: FIB table does not exist. | Dump terminated Instead, store its error message to an according error file. --- grml-hwinfo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grml-hwinfo b/grml-hwinfo index b5329b3..ab2b295 100755 --- a/grml-hwinfo +++ b/grml-hwinfo @@ -261,7 +261,7 @@ cd "${OUTDIR}" || exit 1 exectest ip && ip route show > ip_route exectest ip && if [ -r /etc/iproute2/rt_tables ] ; then grep -v '^#' /etc/iproute2/rt_tables | while read table _ ; do - ip route show table "${table}" > "ip_route_table_${table}" + ip route show table "${table}" > "ip_route_table_${table}" 2> "ip_route_table_${table}".error done fi exectest ip && ip rule show > ip_rule -- 2.1.4