dracut-module-setup.sh: rework kdump_get_ip_route_field
upstream: fedora
resolves: bz2003832
conflict: none
commit 46542ccda5
Author: Kairui Song <kasong@redhat.com>
Date: Wed Aug 4 02:59:43 2021 +0800
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>
Signed-off-by: Tao Liu <ltao@redhat.com>
This commit is contained in:
parent
caa2405338
commit
37b61ee43a
@ -520,9 +520,7 @@ kdump_get_ip_route()
|
|||||||
|
|
||||||
kdump_get_ip_route_field()
|
kdump_get_ip_route_field()
|
||||||
{
|
{
|
||||||
if `echo $1 | grep -q $2`; then
|
echo "$1" | sed -n -e "s/^.*\<$2\>\s\+\(\S\+\).*$/\1/p"
|
||||||
echo ${1##*$2} | cut -d ' ' -f1
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
kdump_get_remote_ip()
|
kdump_get_remote_ip()
|
||||||
|
Loading…
Reference in New Issue
Block a user