diff --git a/inxi b/inxi index fd6cf53..1e86c5d 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.8.9 +#### version: 0.8.10 #### Date: December 14 2008 ######################################################################## #### inxi is a fork of infobash 3.02, the original bash sys info script by locsmif @@ -37,11 +37,12 @@ #### DEPENDENCIES #### bash >=2.05b(bash), df;readlink;stty;tr;uname;wc(coreutils), #### gawk(gawk), grep(grep), hostname(hostname), lspci(pciutils), -#### ps;uptime(procps), runlevel(sysvinit), glxinfo;xdpyinfo;xrandr(xbase-clients) +#### ps;uptime(procps), glxinfo;xdpyinfo;xrandr(xbase-clients) #### Also the proc filesystem should be present and mounted #### #### RECOMMENDS (Needed to run certain features) #### For local interfaces/IP test: ifconfig (in net-tools for Debian systems) +#### runlevel(sysvinit: to view current runlevel while not in X window system ######################################################################## #### CONVENTIONS: #### Indentation: TABS @@ -426,7 +427,7 @@ check_script_depends() { local app_name='' app_data='' # bc removed from deps for now - local depends="df free gawk grep hostname lspci ps readlink runlevel tr uname uptime wc" + local depends="df free gawk grep hostname lspci ps readlink tr uname uptime wc" if [[ ! -d /proc/ ]];then error_handler 6 @@ -2484,8 +2485,9 @@ print_hard_disk_data() print_info_data() { + local suggested_app="runlevel" local info_data='' - local runlvl="$( runlevel | gawk '{ print $2 }' )" + local runlvl='' local memory="$( get_memory_data )" local processes="$(( $( ps aux | wc -l ) - 1 ))" local up_time="$( get_uptime )" @@ -2496,7 +2498,10 @@ print_info_data() # this only triggers if no X data is present if [[ $B_X_RUNNING != 'true' ]];then - info_data="${info_data} ${C1}Runlevel${C2} ${runlvl}${CN}" + if [[ -a $suggested_app ]];then + runlvl="$( runlevel | gawk '{ print $2 }' )" + info_data="${info_data} ${C1}Runlevel${C2} ${runlvl}${CN}" + fi fi if [[ $SHOW_IRC -gt 0 ]];then