Add helper to get nmcli connection show cmd by ifname
Resolves: bz1919052
Upstream: Fedora
Conflict: None
commit 0c292f49c7
Author: Coiby Xu <coxu@redhat.com>
Date: Thu Apr 1 15:32:10 2021 +0800
Add helper to get nmcli connection show cmd by ifname
Signed-off-by: Coiby Xu <coxu@redhat.com>
Acked-by: Kairui Song <kasong@redhat.com>
Signed-off-by: Coiby Xu <coxu@redhat.com>
This commit is contained in:
parent
2f9fc88963
commit
b15a090483
14
kdump-lib.sh
14
kdump-lib.sh
@ -406,6 +406,20 @@ get_nmcli_connection_apath_by_ifname()
|
|||||||
echo -n "$_apath"
|
echo -n "$_apath"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Get nmcli connection show cmd by ifname
|
||||||
|
#
|
||||||
|
# "$_apath" is supposed to not contain any chracter that
|
||||||
|
# need to be escapded, e.g. space. Otherwise get_nmcli_value_by_field
|
||||||
|
# would fail.
|
||||||
|
get_nmcli_connection_show_cmd_by_ifname()
|
||||||
|
{
|
||||||
|
local _ifname="$1"
|
||||||
|
local _apath=$(get_nmcli_connection_apath_by_ifname "$_ifname")
|
||||||
|
local _nm_show_cmd="connection show $_apath"
|
||||||
|
|
||||||
|
echo -n "$_nm_show_cmd"
|
||||||
|
}
|
||||||
|
|
||||||
get_ifcfg_by_device()
|
get_ifcfg_by_device()
|
||||||
{
|
{
|
||||||
grep -E -i -l "^[[:space:]]*DEVICE=\"*${1}\"*[[:space:]]*$" \
|
grep -E -i -l "^[[:space:]]*DEVICE=\"*${1}\"*[[:space:]]*$" \
|
||||||
|
Loading…
Reference in New Issue
Block a user