added some irc blocked output for security, cleaned up a few glitches in -i and -n functions.

Now non irc output is unfiltered, and irc local mac, ip, username output is filtered.
This commit is contained in:
inxi-svn 2011-04-25 18:51:46 +00:00
parent 289a50fe09
commit d1e0999e7b

42
inxi
View file

@ -1,8 +1,8 @@
#!/bin/bash
########################################################################
#### Script Name: inxi
#### version: 1.4.80
#### Date: April 24 2011
#### version: 1.4.81
#### Date: April 25 2011
########################################################################
#### SPECIAL THANKS
########################################################################
@ -4923,7 +4923,11 @@ print_network_advanced_data()
duplex=${a_network_working[8]}
fi
if [[ -n ${a_network_working[9]} ]];then
mac_id=${a_network_working[9]}
if [[ $B_RUNNING_IN_SHELL == 'true' ]];then
mac_id=${a_network_working[9]}
else
mac_id='<irc-filter>'
fi
fi
network_data="${C1}IF:${C2} $if_id ${C1}State:${C2} $oper_state ${C1}Speed:${C2} $speed"
network_data="$network_data ${C1}Duplex:${C2} $duplex ${C1}Mac:${C2} $mac_id"
@ -4939,10 +4943,14 @@ print_networking_ip_data()
eval $LOGFS
local ip=$( get_networking_wan_ip_data )
local ip_data='' a_interfaces_working='' interfaces='' interfaces_2='' i=''
local if_id='' if_ip=''
# set A_INTERFACES_DATA
get_networking_local_ip_data
# first print output for wan ip line. Null is handled in the get function
if [[ -z $ip ]];then
ip='N/A'
fi
ip_data=$( create_print_line " " "${C1}Wan IP:${C2} $ip" )
# then create the list of local interface/ip
@ -4952,15 +4960,23 @@ print_networking_ip_data()
IFS=","
a_interfaces_working=(${A_INTERFACES_DATA[i]})
IFS="$ORIGINAL_IFS"
if_id='N/A'
if_ip='N/A'
if [[ -n ${a_interfaces_working[1]} ]];then
if [[ $B_RUNNING_IN_SHELL == 'true' ]];then
if_ip=${a_interfaces_working[1]}
else
if_ip='<irc-filter>'
fi
fi
if [[ -n ${a_interfaces_working[0]} ]];then
if_id=${a_interfaces_working[0]}
fi
if [[ $i -lt 3 ]];then
if [[ -n ${a_interfaces_working[0]} ]];then
interfaces="$interfaces ${C1}IF IP:${C2} ${a_interfaces_working[0]} ${C1}-${C2} ${a_interfaces_working[1]}"
fi
interfaces="$interfaces ${C1}IF IP:${C2} $if_id ${C1}-${C2} $if_ip"
else
if [[ -n ${a_interfaces_working[0]} ]];then
# space on end here for lining up with line starter
interfaces_2="$interfaces_2${C1}IF IP:${C2} ${a_interfaces_working[0]} ${C1}-${C2} ${a_interfaces_working[1]} "
fi
# space on end here for lining up with line starter
interfaces_2="$interfaces_2${C1}IF IP:${C2} $if_id ${C1}-${C2} $if_ip "
fi
((i++))
done
@ -5049,7 +5065,11 @@ print_partition_data()
full_uuid=" ${C1}uuid:${C2} $part_uuid"
fi
fi
partitionIdClean=$( sed -r 's|/home/(.*)/(.*)|/home/##/\2|' <<< ${a_partition_working[0]} )
if [[ $B_RUNNING_IN_SHELL == 'false' ]];then
partitionIdClean=$( sed -r 's|/home/(.*)/(.*)|/home/##/\2|' <<< ${a_partition_working[0]} )
else
partitionIdClean=${a_partition_working[0]}
fi
# because these lines can vary widely, using dynamic length handling here
a_partition_data[$counter]="${a_partition_data[$counter]}${C1}ID:${C2}$partitionIdClean ${C1}size:${C2} ${a_partition_working[1]}$partition_used$full_fs$full_dev$full_label$full_uuid "