Add helper to get nmcli connection apath by ifname
Resolves: bz1919052
Upstream: Fedora
Conflict: None
commit c69578ca43
Author: Coiby Xu <coxu@redhat.com>
Date:   Thu Apr 1 15:32:09 2021 +0800
    Add helper to get nmcli connection apath by ifname
    apath (a D-Bus active connection path) is used for nmcli connection operations, e.g.
      $ nmcli connection show $apath
    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
							
								
									d09dc2f45e
								
							
						
					
					
						commit
						2f9fc88963
					
				
							
								
								
									
										14
									
								
								kdump-lib.sh
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								kdump-lib.sh
									
									
									
									
									
								
							| @ -392,6 +392,20 @@ get_nmcli_value_by_field() | ||||
|     echo -n "$val" | ||||
| } | ||||
| 
 | ||||
| # Get nmcli connection apath (a D-Bus active connection path ) by ifname | ||||
| # | ||||
| # apath is used for nmcli connection operations, e.g. | ||||
| #  $ nmcli connection show $apath | ||||
| get_nmcli_connection_apath_by_ifname() | ||||
| { | ||||
|     local _ifname=$1 | ||||
|     local _nm_show_cmd="device show $_ifname" | ||||
| 
 | ||||
|     local _apath=$(get_nmcli_value_by_field "$_nm_show_cmd" "GENERAL.CON-PATH") | ||||
| 
 | ||||
|     echo -n "$_apath" | ||||
| } | ||||
| 
 | ||||
| get_ifcfg_by_device() | ||||
| { | ||||
|     grep -E -i -l "^[[:space:]]*DEVICE=\"*${1}\"*[[:space:]]*$" \ | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user