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.
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
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
done
fi
exectest ip && ip rule show > ip_rule