diff options
author | Unit 193 <unit193@ubuntu.com> | 2017-06-05 18:14:07 -0400 |
---|---|---|
committer | Unit 193 <unit193@ubuntu.com> | 2017-06-05 18:14:07 -0400 |
commit | 052cce0c187b13923516adbdcaa7168d858fce20 (patch) | |
tree | cc221d7f277c18a8bafed32ec0c6a3c07987f28b /inxi | |
parent | e1d7c88946542ce91cef3e428d92f683b4b2d52e (diff) | |
download | inxi-052cce0c187b13923516adbdcaa7168d858fce20.tar.bz2 inxi-052cce0c187b13923516adbdcaa7168d858fce20.tar.xz inxi-052cce0c187b13923516adbdcaa7168d858fce20.tar.zst |
New upstream version 2.3.11upstream/2.3.11
Diffstat (limited to 'inxi')
-rwxr-xr-x | inxi | 362 |
1 files changed, 274 insertions, 88 deletions
@@ -1,8 +1,8 @@ #!/usr/bin/env bash ######################################################################## #### Script Name: inxi -#### Version: 2.3.5 -#### Date: 2016-12-02 +#### Version: 2.3.11 +#### Date: 2017-05-31 #### Patch Number: 00 ######################################################################## #### SPECIAL THANKS @@ -20,7 +20,8 @@ #### Gaim/Pidgin, Weechat, KVIrc and Kopete. #### Original infobash author and copyright holder: #### Copyright (C) 2005-2007 Michiel de Boer a.k.a. locsmif -#### inxi version: Copyright (C) 2008-2016 Scott Rogers & Harald Hope +#### inxi version: Copyright (C) 2008-2017 Harald Hope +#### Additional features (C) Scott Rogers - kde, cpu info #### Further fixes (listed as known): Horst Tritremmel <hjt at sidux.com> #### Steven Barrett (aka: damentz) - usb audio patch; swap percent used patch #### Jarett.Stevens - dmidecde -M patch for older systems with the /sys @@ -470,18 +471,18 @@ HDDTEMP_PATH='' MODINFO_PATH='' SUDO_PATH='' -SCRIPT_DATA_DIR="$HOME/.inxi" ALTERNATE_FTP='' # for data uploads ALTERNATE_WEATHER_LOCATION='' # weather alternate location -LOG_FILE="$SCRIPT_DATA_DIR/inxi.log" -LOG_FILE_1="$SCRIPT_DATA_DIR/inxi.1.log" -LOG_FILE_2="$SCRIPT_DATA_DIR/inxi.2.log" +SCRIPT_CONFIG_DIR='' +SCRIPT_DATA_DIR='' +LOG_FILE='inxi.log' +LOG_FILE_1='inxi.1.log' +LOG_FILE_2='inxi.2.log' MAN_FILE_DOWNLOAD='https://github.com/smxi/inxi/raw/master/inxi.1.gz' -MAN_FILE_LOCATION='/usr/share/man/man1' SCRIPT_NAME='inxi' SCRIPT_PATCH_NUMBER='' -SCRIPT_PATH='' #filled-in in Main -SCRIPT_VERSION_NUMBER="" #filled-in in Main +SCRIPT_PATH='' # filled-in in Main +SCRIPT_VERSION_NUMBER='' # filled-in in Main SCRIPT_DOWNLOAD='https://github.com/smxi/inxi/raw/master/' SCRIPT_DOWNLOAD_BRANCH_1='https://github.com/smxi/inxi/raw/one/' SCRIPT_DOWNLOAD_BRANCH_2='https://github.com/smxi/inxi/raw/two/' @@ -677,6 +678,9 @@ USB_NETWORK_SEARCH="$USB_NETWORK_SEARCH|050d:935b|0bda:8189|0bda:8197" ######################################################################## main() { + # This must be set first so log paths are present when logging starts. + set_user_paths + eval $LOGFS local color_scheme='' kde_config_app='' @@ -692,9 +696,10 @@ main() source /etc/$SCRIPT_NAME.conf fi # Source user config variables override /etc/inxi.conf variables - if [[ -s $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf ]];then - source $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf + if [[ -s $SCRIPT_CONFIG_DIR/$SCRIPT_NAME.conf ]];then + source $SCRIPT_CONFIG_DIR/$SCRIPT_NAME.conf fi + set_display_width 'live' # can be reset with -y # echo SCHEME $SCHEME @@ -826,6 +831,49 @@ main() exit 0 } +set_user_paths() +{ + local b_conf='false' b_data='false' + + if [[ -n $XDG_CONFIG_HOME ]];then + SCRIPT_CONFIG_DIR=$XDG_CONFIG_HOME + b_conf=true + elif [[ -d $HOME/.config ]];then + SCRIPT_CONFIG_DIR=$HOME/.config + b_conf=true + else + SCRIPT_CONFIG_DIR="$HOME/.$SCRIPT_NAME" + fi + if [[ -n $XDG_DATA_HOME ]];then + SCRIPT_DATA_DIR=$XDG_DATA_HOME/$SCRIPT_NAME + b_data=true + elif [[ -d $HOME/.local/share ]];then + SCRIPT_DATA_DIR=$HOME/.local/share/$SCRIPT_NAME + b_data=true + else + SCRIPT_DATA_DIR="$HOME/.$SCRIPT_NAME" + fi + # note, this used to be created/checked in specific instance, but we'll just do it + # universally so it's done at script start. + if [[ ! -d $SCRIPT_DATA_DIR ]];then + mkdir $SCRIPT_DATA_DIR + fi + + if [[ $b_conf == 'true' && -f $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf ]];then + mv -f $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf $SCRIPT_CONFIG_DIR + echo "Moved $SCRIPT_NAME.conf from $HOME/.$SCRIPT_NAME to $SCRIPT_CONFIG_DIR" + fi + if [[ $b_data == 'true' && -d $HOME/.$SCRIPT_NAME ]];then + mv -f $HOME/.$SCRIPT_NAME/* $SCRIPT_DATA_DIR + rm -Rf $HOME/.$SCRIPT_NAME + echo "Moved data dir $HOME/.$SCRIPT_NAME to $SCRIPT_DATA_DIR" + fi + + LOG_FILE=$SCRIPT_DATA_DIR/$LOG_FILE + LOG_FILE_1=$SCRIPT_DATA_DIR/$LOG_FILE_1 + LOG_FILE_2=$SCRIPT_DATA_DIR/$LOG_FILE_2 +} + #### ------------------------------------------------------------------- #### basic tests: set script data, booleans, PATH, version numbers #### ------------------------------------------------------------------- @@ -1210,7 +1258,7 @@ select_default_color_scheme() { eval $LOGFS local spacer=' ' options='' user_selection='' config_variable='' - local config_file="$HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf" + local config_file="$SCRIPT_CONFIG_DIR/$SCRIPT_NAME.conf" local irc_clear="[0m" local irc_gui='Unset' irc_console='Unset' irc_x_term='Unset' local console='Unset' virt_term='Unset' global='Unset' @@ -1307,9 +1355,6 @@ select_default_color_scheme() set_color_scheme $user_selection # make file/directory first if missing if [[ ! -f $config_file ]];then - if [[ ! -d $HOME/.$SCRIPT_NAME ]];then - mkdir $HOME/.$SCRIPT_NAME - fi touch $config_file fi if [[ -z $( grep -s "$config_variable=" $config_file ) ]];then @@ -1533,9 +1578,6 @@ log_function_data() # will have max 3 files, inxi.log, inxi.1.log, inxi.2.log create_rotate_logfiles() { - if [[ ! -d $SCRIPT_DATA_DIR ]];then - mkdir $SCRIPT_DATA_DIR - fi # do the rotation if logfile exists if [[ -f $LOG_FILE ]];then # copy if present second to third @@ -1561,7 +1603,8 @@ script_self_updater() { eval $LOGFS local downloader_error=0 file_contents='' downloader_man_error=0 - local man_file_path="$MAN_FILE_LOCATION/inxi.1.gz" + local man_file_location=$( set_man_location ) + local man_file_path="$man_file_location/inxi.1.gz" if [[ $B_IRC == 'true' ]];then print_screen_output "Sorry, you can't run the $SCRIPT_NAME self updater option (-$3) in an IRC client." @@ -1603,14 +1646,14 @@ script_self_updater() print_screen_output "To run the new version, just start $SCRIPT_NAME again." print_screen_output "----------------------------------------" print_screen_output "Starting download of man page file now." - if [[ ! -d $MAN_FILE_LOCATION ]];then - print_screen_output "The required man directory was not detected on your system, unable to continue: $MAN_FILE_LOCATION" + if [[ ! -d $man_file_location ]];then + print_screen_output "The required man directory was not detected on your system, unable to continue: $man_file_location" else if [[ $B_ROOT == 'true' ]];then print_screen_output "Checking Man page download URL..." if [[ -f /usr/share/man/man8/inxi.8.gz ]];then print_screen_output "Updating man page location to man1." - mv -f /usr/share/man/man8/inxi.8.gz /usr/share/man/man1/inxi.1.gz + mv -f /usr/share/man/man8/inxi.8.gz $man_file_location/inxi.1.gz if type -p mandb &>/dev/null;then exec $( type -p mandb ) -q fi @@ -1650,7 +1693,7 @@ script_self_updater() print_screen_output "Man file download URL failed, unable to continue: $MAN_FILE_DOWNLOAD" fi else - print_screen_output "Updating / Installing the Man page requires root user, writing to: $MAN_FILE_LOCATION" + print_screen_output "Updating / Installing the Man page requires root user, writing to: $man_file_location" print_screen_output "If you want the man page, you'll have to run $SCRIPT_NAME -$3 as root." fi fi @@ -1671,6 +1714,40 @@ script_self_updater() eval $LOGFS } +set_man_location() +{ + local location='' default_location='/usr/share/man/man1' + local man_paths=$(man --path 2>/dev/null) man_local='/usr/local/share/man' + local b_use_local=false + + if [[ -n "$man_paths" && -n $( grep $man_local <<< "$man_paths" ) ]];then + b_use_local=true + fi + + # for distro installs, existing inxi man manual installs, do nothing + if [[ -f $default_location/inxi.1.gz ]];then + location=$default_location + else + if [[ $b_use_local == 'true' ]];then + if [[ ! -d $man_local/man1 ]];then + mkdir $man_local/man1 + fi + location="$man_local/man1" + fi +# print_screen_output "Updating man page location to man1." +# mv -f /usr/share/man/man1/inxi.1.gz /usr/local/share/man/man1/inxi.1.gz +# if type -p mandb &>/dev/null;then +# exec $( type -p mandb ) -q +# fi + fi + + if [[ -z "$location" ]];then + location=$default_location + fi + + echo $location +} + # args: $1 - debug data type: sys|xorg|disk debug_data_collector() { @@ -1706,11 +1783,6 @@ debug_data_collector() ftp_upload=$ALTERNATE_FTP fi echo "Starting debugging data collection type: $1" - echo -n "Checking/creating required directories... " - if [[ ! -d $SCRIPT_DATA_DIR ]];then - mkdir $SCRIPT_DATA_DIR - fi - echo 'completed' cd $SCRIPT_DATA_DIR if [[ -d $SCRIPT_DATA_DIR/$debug_data_dir ]];then echo 'Deleting previous xiin data directory...' @@ -1887,6 +1959,10 @@ debug_data_collector() # bsd data cat /var/run/dmesg.boot &> $debug_data_dir/bsd-var-run-dmesg.boot.txt echo $COLS_INNER &> $debug_data_dir/cols-inner.txt + echo $XDG_CONFIG_HOME &> $debug_data_dir/xdg_config_home.txt + echo $XDG_CONFIG_DIRS &> $debug_data_dir/xdg_config_dirs.txt + echo $XDG_DATA_HOME &> $debug_data_dir/xdg_data_home.txt + echo $XDG_DATA_DIRS &> $debug_data_dir/xdg_data_dirs.txt check_recommends_user_output &> $debug_data_dir/check-recommends-user-output.txt # first download and verify xiin @@ -3055,7 +3131,7 @@ show_options() print_lines_basic "2" "-D" "Hdd temp with disk data if you have hddtemp installed, if you are root OR if you have added to /etc/sudoers (sudo v. 1.7 or newer) Example:^<username>^ALL^=^NOPASSWD:^/usr/sbin/hddtemp" print_lines_basic "2" "-G" "Direct rendering status for Graphics (in X)." print_lines_basic "2" "-G" "(for single gpu, nvidia driver) screen number gpu is running on." - print_lines_basic "2" "-i" "IPv6 as well for LAN interface (IF) devices." + print_lines_basic "2" "-i" "For IPv6, show additional IP v6 scope addresses: Global, Site, Temporary, Unknown." print_lines_basic "2" "-I" "System GCC, default. With -xx, also show other installed GCC versions. If running in console, not in IRC client, shows shell version number, if detected. Init/RC Type and runlevel (if available)." print_lines_basic "2" "-m" "Part number; Max memory module size (if available)." print_lines_basic "2" "-N -A" "Version/port(s)/driver version (if available) for Network/Audio;" @@ -5955,7 +6031,7 @@ get_dmidecode_data() sub(/^[[:space:]]+/, "", twoData) sub(/^Base Board .*|^Chassis .*|empty|.*O\.E\.M\..*|.*OEM.*|^Not .*|^System .*|.*unknow.*|.*N\/A.*|none|^To be filled.*|^0x[0]+$|\[Empty\]|<Bad Index>|^\.\.$/, "", twoData) sub(/.*(AssetTagNum|Manufacturer| Or Motherboard|PartNum.*|SerNum).*/, "", twoData) - gsub(/bios|acpi/, "", twoData) + gsub(/\ybios\y|\yacpi\y/, "", twoData) # note: biostar sub(/http:\/\/www.abit.com.tw\//, "Abit", twoData) # for double indented values replace with ~ so later can test for it, we are trusting that @@ -6193,8 +6269,8 @@ get_graphics_card_data() gsub(/'"$BAN_LIST_ARRAY"'/, " ", $NF) gsub(/^ +| +$/, "", $NF) gsub(/ [ \t]+/, " ", $NF) - busId=gensub(/^([0-9a-f:\.]+) (.+)$/,"\\1","",$1) - trueCard=gensub(/(.*)\.([0-9]+)$/,"\\2","",busId) + busId=gensub(/^([0-9a-f:\.]+) (.+)$/,"\\1",1,$1) + trueCard=gensub(/(.*)\.([0-9]+)$/,"\\2",1,busId) if ( trueCard == 0 ) { print $NF "," busId } @@ -6217,7 +6293,7 @@ get_graphics_driver() eval $LOGFS # list is from sgfxi plus non-free drivers - local driver_list='amdgpu|apm|ark|ati|chips|cirrus|cyrix|fbdev|fglrx|glint|i128|i740|i810|iftv|imstt|intel|ivtv|mach64|mesa|mga|modesetting|neomagic|newport|nouveau|nsc|nvidia|nv|openchrome|radeonhd|radeon|rendition|s3virge|s3|savage|siliconmotion|sisusb|sis|tdfx|tga|trident|tseng|unichrome|v4l|vboxvideo|vesa|vga|via|vmware|voodoo' + local driver_list='amdgpu|apm|ark|ati|chips|cirrus|cyrix|fbdev|fglrx|glint|i128|i740|i810|iftv|imstt|intel|ivtv|mach64|mesa|mga|modesetting|neomagic|newport|nouveau|nsc|nvidia|nv|openchrome|radeonhd|radeon|rendition|s3virge|s3|savage|siliconmotion|sisimedia|sisusb|sis|tdfx|tga|trident|tseng|unichrome|v4l|vboxvideo|vesa|vga|via|vmware|voodoo' local driver='' driver_string='' xorg_log_data='' status='' a_temp='' if [[ $B_XORG_LOG == 'true' ]];then @@ -6442,7 +6518,7 @@ get_graphics_display_server_data() vendorRelease="" } /vendor string/ { - gsub(/the|inc|foundation|project|corporation/, "", $2) + gsub(/\ythe\y|\yinc\y|foundation|project|corporation/, "", $2) gsub(/'"$BAN_LIST_ARRAY"'/, " ", $2) gsub(/^ +| +$/, "", $2) gsub(/ [ \t]+/, " ", $2) @@ -6584,6 +6660,7 @@ get_hdd_data_basic() fi # echo ss: $swap_size hdd_data="$( eval $df_string )" + # eval $df_string | awk 'BEGIN{tot=0} !/total/ {tot+=$4} END{print tot}' log_function_data 'raw' "hdd_data:\n$hdd_data" hdd_used=$( echo "$hdd_data" | gawk -v bsdType="$BSD_TYPE" -v swapSize="$swap_size" ' @@ -7014,7 +7091,7 @@ get_hdd_temp_data() { eval $LOGFS local hdd_temp='' sudo_command='' - + if [[ $B_HDDTEMP_TESTED != 'true' ]];then B_HDDTEMP_TESTED='true' HDDTEMP_PATH=$( type -p hddtemp ) @@ -7138,6 +7215,24 @@ get_init_data() eval $LOGFE } +# note: useless because this is just absurdly inaccurate, too bad... +get_install_date() +{ + eval $LOGFS + + local installed='' + + if ls -al --time-style '+FORMAT %Y-%m-%d' /usr 2>/dev/null;then + installed=$(ls -al --time-style '+FORMAT %Y-%m-%d' / | awk '/lost\+found/ {print $7;exit}' ) +# elif +# : + fi + + echo $installed + + eval $LOGFE +} + get_kernel_compiler_version() { # note that we use gawk to get the last part because beta, alpha, git versions can be non-numeric @@ -7280,7 +7375,7 @@ get_machine_data() # System manufacturer|System Product Name|System Version # To Be Filled By O.E.M. sub(/^Base Board .*|^Chassis .*|.*O\.E\.M\..*|.*OEM.*|^Not .*|^System .*|.*unknow.*|.*N\/A.*|none|^To be filled.*/, "", $0) - gsub(/bios|acpi/, "", $0) + gsub(/\ybios\y|\yacpi\y/, "", $0) # note: biostar sub(/http:\/\/www.abit.com.tw\//, "Abit", $0) gsub(/^ +| +$/, "", $0) gsub(/ [ \t]+/, " ", $0) @@ -7998,8 +8093,11 @@ get_networking_local_ip_data() gawk -v ipTool=$ip_tool -v bsdType=$BSD_TYPE ' BEGIN { IGNORECASE=1 + addExtV6 = "" + addIpV6 = "" interface="" - ifIp="" + ipExtV6="" + ifIpV4="" ifIpV6="" ifMask="" } @@ -8018,49 +8116,110 @@ get_networking_local_ip_data() interface = $1 # prep this this for ip addr: eth0: sub(/:/, "", interface) - ifIp="" + ifIpV4="" ifIpV6="" ifMask="" + ipExtV6="" aInterfaces[interface]++ - + while (getline && !/^$/ ) { + addIpV6 = "" + 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 ) } } if (/inet6 addr:/) { - ifIpV6 = $3 + # ^fe80: + if ( $2 ~ /^fe80/) { + addIpV6 = $2 + } + else if ( $0 ~ /<global>/ || $0 ~ /Scope:Global/ ) { + addExtV6 = "sg~" $2 + } + # ^fec0: + else if ( $0 ~ /<site>/ || $0 ~ /Scope:Site/ || $2 ~ /^fec0/ || $2 ~ /^fc00/) { + addExtV6 = "ss~" $2 + } + else { + addExtV6 = "su~" $2 + } } if ( bsdType == "bsd" ) { if ( $1 == "inet" ) { - ifIp = $2 + ifIpV4 = $2 if ( $3 == "netmask" ) { ifMask = $4 } } - if ( $0 ~ /inet6.*%/ ) { + # bsds end ip with %em1 (% + interface name) + if ( $0 ~ /inet6.*%/ ){ sub(/%.*/,"",$2) - ifIpV6 = $2 + if ( $2 ~ /^fe80/ ) { + addIpV6 = $2 + } + else if ( $2 ~ /^fec0/ || $2 ~ /^fc00/ ) { + addExtV6 = "ss~" $2 + } + else { + addExtV6 = "sg~" $2 + } } } } else if ( ipTool == "ip" ) { if ( $1 == "inet" ) { - ifIp = $2 + ifIpV4 = $2 + } + if ( $1 == "inet6" ){ + # filter out deprecated IPv6 privacy addresses + if ( $0 ~ / temporary deprecated/) { + addExtV6 = "" + } + else if ( $0 ~ /scope global temporary/) { + addExtV6 = "st~" $2 + } + else if ( $0 ~ /scope global/) { + addExtV6 = "sg~" $2 + } + # ^fe80: + else if ( $2 ~ /^fe80/ || $0 ~ /scope link/) { + addIpV6 = $2 + } + # ^fec0: + else if ( $2 ~ /^fec0/ || $2 ~ /^fc00/ || $0 ~ /scope site/) { + addExtV6 = "ss~" $2 + } + else { + addExtV6 = "su~" $2 + } + } + } + if ( addIpV6 != "" ) { + if ( ifIpV6 == "" ) { + ifIpV6 = addIpV6 } - if ( $1 == "inet6" ) { - ifIpV6 = $2 + else { + ifIpV6 = ifIpV6 "^" addIpV6 + } + } + if (addExtV6 != "" ){ + if ( ipExtV6 == "" ){ + ipExtV6 = addExtV6 + } + else { + ipExtV6 = ipExtV6 "^" addExtV6 } } } # 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]+/, "", ifIpV6) - ipAddresses[interface] = ifIp "," ifMask "," ifIpV6 + sub(/\/[0-9]+/, "", ifIpV4) + gsub(/\/[0-9]+/, "", ifIpV6) # + ipAddresses[interface] = ifIpV4 "," ifMask "," ifIpV6 "," ipExtV6 } END { j=0 @@ -13420,6 +13579,7 @@ print_network_advanced_data() print_networking_ip_data() { eval $LOGFS + # $ip should be IPv4 local ip=$( get_networking_wan_ip_data ) local wan_ip_data='' a_interfaces_working='' interfaces='' i=0 local if_id='' if_ip='' if_ipv6='' if_ipv6_string='' full_string='' if_string='' @@ -13451,60 +13611,85 @@ print_networking_ip_data() if [[ -n ${a_interfaces_working[1]} ]];then if [[ $B_OUTPUT_FILTER == 'true' ]];then if_ip=$FILTER_STRING + # we could filter each ipv6 extra address, but that can lead to + # a LOT of pointless output depending on the ip tool used and how + # many deprecated addresses there are, so just delete the values + a_interfaces_working[4]='' else if_ip=${a_interfaces_working[1]} fi fi if_ip_string=" ${C1}ip-v4$SEP3${C2} $if_ip" - if [[ $B_EXTRA_DATA == 'true' ]];then - if [[ -n ${a_interfaces_working[3]} ]];then - if [[ $B_OUTPUT_FILTER == 'true' ]];then - if_ipv6=$FILTER_STRING - else - if_ipv6=${a_interfaces_working[3]} - fi + # this is now going to always show as IPv6 starts to really be used globally + if [[ -n ${a_interfaces_working[3]} ]];then + if [[ $B_OUTPUT_FILTER == 'true' ]];then + if_ipv6=$FILTER_STRING + else + # may be more than one address here; get them all as one string + # but this is only the LINK scope, not Site or Global or Temporary + if_ipv6=${a_interfaces_working[3]/^/, } fi - if_ipv6_string=" ${C1}ip-v6$SEP3${C2} $if_ipv6" fi + if_ipv6_string=" ${C1}ip-v6-link$SEP3${C2} $if_ipv6" fi if [[ -n ${a_interfaces_working[0]} ]];then if_id=${a_interfaces_working[0]} fi if_string="${C1}IF$SEP3${C2} $if_id$if_ip_string$if_ipv6_string " - # first line, print wan on its own line if too long + # first line, print wan on its own line, then the next item if [[ $i -eq 0 ]];then - if [[ $( calculate_line_length "$wan_ip_data$if_string" ) -gt $COLS_INNER ]];then - full_string=$( create_print_line " " "$wan_ip_data" ) - print_screen_output "$full_string" - wan_ip_data='' - full_string=$( create_print_line " " "$if_string" ) - print_screen_output "$full_string" - if_string='' - else - full_string=$( create_print_line " " "$wan_ip_data$if_string" ) - print_screen_output "$full_string" - wan_ip_data='' - if_string='' - fi - else - if [[ $( calculate_line_length "$if_string_holding$if_string" ) -gt $COLS_INNER ]];then - if [[ -n $if_string_holding ]];then - full_string=$( create_print_line " " "$if_string_holding" ) - print_screen_output "$full_string" - fi - if_string_holding="$if_string" - else - if_string_holding="$if_string_holding$if_string" - fi + full_string=$( create_print_line " " "$wan_ip_data" ) + print_screen_output "$full_string" + wan_ip_data='' + fi + full_string=$( create_print_line " " "$if_string" ) + print_screen_output "$full_string" + if_string='' + if [[ ${a_interfaces_working[4]} != '' && $B_EXTRA_DATA == 'true' ]];then + IFS="^" + a_ipv6_ext=(${a_interfaces_working[4]}) + IFS="$ORIGINAL_IFS" + for (( j=0; j < ${#a_ipv6_ext[@]}; j++ )) + do + print_ipv6_ext_line "${a_ipv6_ext[j]}" + done fi ((i++)) done - # then print out anything not printed already - if [[ -n $if_string_holding ]];then - full_string=$( create_print_line " " "$if_string_holding" ) - print_screen_output "$full_string" + eval $LOGFE +} +print_ipv6_ext_line() +{ + eval $LOGFS + + local full_string='' ip_starter='' ip_data='' ip='' + + case $1 in + sg~*) + ip_starter="ip-v6-global" + ip=${1/sg~/} + ;; + ss~*) + ip_starter="ip-v6-site" + ip=${1/ss~/} + ;; + st~*) + ip_starter="ip-v6-temporary" + ip=${1/st~/} + ;; + su~*) + ip_starter="ip-v6-unknown" + ip=${1/su~/} + ;; + esac + if [[ $B_OUTPUT_FILTER == 'true' ]];then + ip=$FILTER_STRING fi + ip_data="${C1}$ip_starter$SEP3${C2} $ip" + full_string=$( create_print_line " " "$ip_data" ) + print_screen_output "$full_string" + eval $LOGFE } @@ -14963,7 +15148,8 @@ print_weather_data() country=" $openP${a_location[5]}$closeP" fi if [[ -n ${a_weather[10]} ]];then - altitude=" ${C1}Altitude$SEP3${C2} ${a_weather[10]}" + # note: bug in source data uses ft for meters, not 100% of time, but usually + altitude=" ${C1}Altitude$SEP3${C2} ${a_weather[10]/ft/m}" fi location_string="${C1}Location$SEP3${C2}$city$state$country$altitude " else |