dracut-module-setup.sh: rework kdump_get_ip_route_field
Avoid duplicated echo / cut / grep call, just use sed. Signed-off-by: Kairui Song <kasong@redhat.com> Acked-by: Philipp Rudo <prudo@redhat.com>
This commit is contained in:
parent
982205d607
commit
46542ccda5
@ -523,9 +523,7 @@ kdump_get_ip_route()
|
||||
|
||||
kdump_get_ip_route_field()
|
||||
{
|
||||
if `echo $1 | grep -q $2`; then
|
||||
echo ${1##*$2} | cut -d ' ' -f1
|
||||
fi
|
||||
echo "$1" | sed -n -e "s/^.*\<$2\>\s\+\(\S\+\).*$/\1/p"
|
||||
}
|
||||
|
||||
kdump_get_remote_ip()
|
||||
|
Loading…
Reference in New Issue
Block a user