variable name cleanup

This commit is contained in:
Harald Hope 2017-05-31 17:14:42 -07:00
parent fcd2752960
commit 716f02e5c9

14
inxi
View file

@ -8096,7 +8096,7 @@ get_networking_local_ip_data()
addIpV6 = "" addIpV6 = ""
interface="" interface=""
ipExtV6="" ipExtV6=""
ifIp="" ifIpV4=""
ifIpV6="" ifIpV6=""
ifMask="" ifMask=""
} }
@ -8115,7 +8115,7 @@ get_networking_local_ip_data()
interface = $1 interface = $1
# prep this this for ip addr: eth0: # prep this this for ip addr: eth0:
sub(/:/, "", interface) sub(/:/, "", interface)
ifIp="" ifIpV4=""
ifIpV6="" ifIpV6=""
ifMask="" ifMask=""
ipExtV6="" ipExtV6=""
@ -8126,7 +8126,7 @@ get_networking_local_ip_data()
addExtV6 = "" addExtV6 = ""
if ( ipTool == "ifconfig" ) { if ( ipTool == "ifconfig" ) {
if (/inet addr:/) { if (/inet addr:/) {
ifIp = gensub( /addr:([0-9\.]+)/, "\\1", "g", $2 ) ifIpV4 = gensub( /addr:([0-9\.]+)/, "\\1", "g", $2 )
if (/mask:/) { if (/mask:/) {
ifMask = gensub( /mask:([0-9\.]+)/, "\\1", "g", $NF ) ifMask = gensub( /mask:([0-9\.]+)/, "\\1", "g", $NF )
} }
@ -8149,7 +8149,7 @@ get_networking_local_ip_data()
} }
if ( bsdType == "bsd" ) { if ( bsdType == "bsd" ) {
if ( $1 == "inet" ) { if ( $1 == "inet" ) {
ifIp = $2 ifIpV4 = $2
if ( $3 == "netmask" ) { if ( $3 == "netmask" ) {
ifMask = $4 ifMask = $4
} }
@ -8171,7 +8171,7 @@ get_networking_local_ip_data()
} }
else if ( ipTool == "ip" ) { else if ( ipTool == "ip" ) {
if ( $1 == "inet" ) { if ( $1 == "inet" ) {
ifIp = $2 ifIpV4 = $2
} }
if ( $1 == "inet6" ){ if ( $1 == "inet6" ){
# filter out deprecated IPv6 privacy addresses # filter out deprecated IPv6 privacy addresses
@ -8216,9 +8216,9 @@ get_networking_local_ip_data()
} }
# slice off the digits that are sometimes tacked to the end of the address, # slice off the digits that are sometimes tacked to the end of the address,
# like: /64 or /24 # like: /64 or /24
sub(/\/[0-9]+/, "", ifIp) sub(/\/[0-9]+/, "", ifIpV4)
gsub(/\/[0-9]+/, "", ifIpV6) # gsub(/\/[0-9]+/, "", ifIpV6) #
ipAddresses[interface] = ifIp "," ifMask "," ifIpV6 "," ipExtV6 ipAddresses[interface] = ifIpV4 "," ifMask "," ifIpV6 "," ipExtV6
} }
END { END {
j=0 j=0