diff options
author | Unit 193 <unit193@ubuntu.com> | 2014-10-13 23:54:21 -0400 |
---|---|---|
committer | Unit 193 <unit193@ubuntu.com> | 2014-10-13 23:54:21 -0400 |
commit | 7b6b87655617da65c88b4e779fe11921a41fbb0a (patch) | |
tree | 31791277879ce6c6f0f4b0504d6355f5635792cc /inxi | |
parent | 821d590a7a25d7e42766d5d34c993b9baa4af965 (diff) | |
download | inxi-7b6b87655617da65c88b4e779fe11921a41fbb0a.tar.bz2 inxi-7b6b87655617da65c88b4e779fe11921a41fbb0a.tar.xz inxi-7b6b87655617da65c88b4e779fe11921a41fbb0a.tar.zst |
Imported Upstream version 2.2.15upstream/2.2.15
Diffstat (limited to 'inxi')
-rwxr-xr-x | inxi | 28 |
1 files changed, 19 insertions, 9 deletions
@@ -1,8 +1,8 @@ #!/usr/bin/env bash ######################################################################## #### Script Name: inxi -#### Version: 2.2.14 -#### Date: 2014-09-26 +#### Version: 2.2.15 +#### Date: 2014-10-12 #### Patch Number: 00 ######################################################################## #### SPECIAL THANKS @@ -53,7 +53,7 @@ #### DEPENDENCIES #### * bash >=3.0 (bash); df, readlink, stty, tr, uname, wc (coreutils); #### gawk (gawk); grep (grep); lspci (pciutils); -#### ps, uptime (procps); find (findutils) +#### ps, find (findutils) #### * Also the proc filesystem should be present and mounted for Linux #### * Some features, like -M and -d will not work, or will work incompletely, #### if /sys is missing @@ -74,6 +74,7 @@ #### -G - full graphics output requires: glxinfo (mesa-utils); xdpyinfo (X11-utils); #### xrandr (x11-xserver-utils) #### -i - IP information, local/wan - ip (iproute) legacy, not used if ip present: ifconfig (net-tools) +#### -I - uptime (procps, check Debian if changed) #### -Ix - view current runlevel while not in X window system (or with -x): runlevel (sysvinit) #### -m - all systems, dmidecode, unless someone can find a better way. #### -M - for older systems whose kernel does not have /sys data for machine, dmidecode (dmidecode) @@ -1062,7 +1063,7 @@ check_required_apps() eval $LOGFS local app_name='' # bc removed from deps for now - local depends="df gawk grep ps readlink tr uname uptime wc" + local depends="df gawk grep ps readlink tr uname wc" if [[ -z $BSD_TYPE ]];then depends="$depends lspci" @@ -2066,7 +2067,6 @@ check_recommends_items() sed:sed~sed~sed~:string_replace tr:coreutils~coreutils~coreutils~:character_replace uname:uname~coreutils~coreutils~:kernel_data - uptime:procps~procps~procps~: wc:coreutils~coreutils~coreutils~:word_character_count ' local x_recommends=' @@ -2087,6 +2087,7 @@ check_recommends_items() modinfo:module-init-tools~module-init-tools~module-init-tools~:-Ax,-Nx_module_version runlevel:sysvinit~sysvinit~systemd~:-I_runlevel sudo:sudo~sudo~sudo~:-Dx_hddtemp-user;-o_file-user + uptime:procps~procps~procps~:-I_uptime_(check_which_package_owns_Debian) ' local downloaders=" @@ -10380,11 +10381,14 @@ get_unmounted_partition_filesystem() get_uptime() { eval $LOGFS + local uptime_value='' ## note: removing gsub(/ /,"",a); to get get space back in there, goes right before print a - local uptime_value="$( uptime | gawk '{ - a = gensub(/^.*up *([^,]*).*$/,"\\1","g",$0) - print a - }' )" + if type -p uptime &>/dev/null;then + uptime_value="$( uptime | gawk '{ + a = gensub(/^.*up *([^,]*).*$/,"\\1","g",$0) + print a + }' )" + fi echo "$uptime_value" log_function_data "uptime_value: $uptime_value" eval $LOGFE @@ -10912,6 +10916,9 @@ print_short_data() local short_data='' i='' b_background_black='false' local memory=$( get_memory_data ) local up_time="$( get_uptime )" + if [[ -z $up_time ]];then + up_time='N/A - missing uptime?' + fi # set A_CPU_CORE_DATA get_cpu_core_count @@ -11872,6 +11879,9 @@ print_info_data() local memory="$( get_memory_data )" local processes=$(( $( wc -l <<< "$Ps_aux_Data" ) - 1 )) local up_time="$( get_uptime )" + if [[ -z $up_time ]];then + up_time='N/A - missing uptime?' + fi local patch_version_number=$( get_patch_version_string ) local gcc_installed='' gcc_others='' closing_data='' |