mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 16:21:39 +00:00
variable name cleanup
This commit is contained in:
parent
fcd2752960
commit
716f02e5c9
14
inxi
14
inxi
|
@ -8096,7 +8096,7 @@ get_networking_local_ip_data()
|
|||
addIpV6 = ""
|
||||
interface=""
|
||||
ipExtV6=""
|
||||
ifIp=""
|
||||
ifIpV4=""
|
||||
ifIpV6=""
|
||||
ifMask=""
|
||||
}
|
||||
|
@ -8115,7 +8115,7 @@ get_networking_local_ip_data()
|
|||
interface = $1
|
||||
# prep this this for ip addr: eth0:
|
||||
sub(/:/, "", interface)
|
||||
ifIp=""
|
||||
ifIpV4=""
|
||||
ifIpV6=""
|
||||
ifMask=""
|
||||
ipExtV6=""
|
||||
|
@ -8126,7 +8126,7 @@ get_networking_local_ip_data()
|
|||
addExtV6 = ""
|
||||
if ( ipTool == "ifconfig" ) {
|
||||
if (/inet addr:/) {
|
||||
ifIp = gensub( /addr:([0-9\.]+)/, "\\1", "g", $2 )
|
||||
ifIpV4 = gensub( /addr:([0-9\.]+)/, "\\1", "g", $2 )
|
||||
if (/mask:/) {
|
||||
ifMask = gensub( /mask:([0-9\.]+)/, "\\1", "g", $NF )
|
||||
}
|
||||
|
@ -8149,7 +8149,7 @@ get_networking_local_ip_data()
|
|||
}
|
||||
if ( bsdType == "bsd" ) {
|
||||
if ( $1 == "inet" ) {
|
||||
ifIp = $2
|
||||
ifIpV4 = $2
|
||||
if ( $3 == "netmask" ) {
|
||||
ifMask = $4
|
||||
}
|
||||
|
@ -8171,7 +8171,7 @@ get_networking_local_ip_data()
|
|||
}
|
||||
else if ( ipTool == "ip" ) {
|
||||
if ( $1 == "inet" ) {
|
||||
ifIp = $2
|
||||
ifIpV4 = $2
|
||||
}
|
||||
if ( $1 == "inet6" ){
|
||||
# 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,
|
||||
# like: /64 or /24
|
||||
sub(/\/[0-9]+/, "", ifIp)
|
||||
sub(/\/[0-9]+/, "", ifIpV4)
|
||||
gsub(/\/[0-9]+/, "", ifIpV6) #
|
||||
ipAddresses[interface] = ifIp "," ifMask "," ifIpV6 "," ipExtV6
|
||||
ipAddresses[interface] = ifIpV4 "," ifMask "," ifIpV6 "," ipExtV6
|
||||
}
|
||||
END {
|
||||
j=0
|
||||
|
|
Loading…
Reference in a new issue