mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 16:21:39 +00:00
more code cleanup
This commit is contained in:
parent
28be7483ec
commit
fa66c967b5
35
inxi
35
inxi
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
########################################################################
|
||||
#### Script Name: inxi
|
||||
#### version: 0.1.2
|
||||
#### version: 0.1.3
|
||||
#### Date: October 27 2008
|
||||
########################################################################
|
||||
#### inxi is a fork of infobash, the original bash sys info script by locsmif
|
||||
|
@ -243,6 +243,7 @@ mkbans()
|
|||
cscheme()
|
||||
{
|
||||
local I SCOLORS CLCODES
|
||||
|
||||
if [[ $1 -ge ${#SCHEMES[@]} ]]
|
||||
then
|
||||
set -- 1
|
||||
|
@ -366,7 +367,8 @@ roots()
|
|||
*perl*)
|
||||
unset IRCV # KSirc is one of the possibilities now. KSirc is a wrapper around dsirc, a perl client
|
||||
getcmdline $PPID
|
||||
for ((I=0; I<=$CMDLMAX; I++)); do
|
||||
for ((I=0; I<=$CMDLMAX; I++))
|
||||
do
|
||||
case ${CMDL[I]} in
|
||||
*dsirc*)
|
||||
IRC="KSirc"
|
||||
|
@ -383,7 +385,10 @@ roots()
|
|||
;;
|
||||
esac
|
||||
done
|
||||
[[ -z $IRCV ]] && IRC="Unknown Perl client"
|
||||
if [[ -z $IRCV ]]
|
||||
then
|
||||
IRC="Unknown Perl client"
|
||||
fi
|
||||
;;
|
||||
*bash*|*sh*)
|
||||
unset IRCV
|
||||
|
@ -405,7 +410,7 @@ roots()
|
|||
}
|
||||
|
||||
# Get the parameters
|
||||
getparams()
|
||||
get_parameters()
|
||||
{
|
||||
if [[ -z $1 ]]
|
||||
then
|
||||
|
@ -456,7 +461,10 @@ getparams()
|
|||
;;
|
||||
*)
|
||||
echo "$1" | grep -q '^[0-9][0-9]\?$' || error 3 "$1"
|
||||
((CSCHEME)) || cscheme "$1"
|
||||
if ! ((CSCHEME))
|
||||
then
|
||||
cscheme "$1"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
|
@ -541,7 +549,7 @@ then
|
|||
fi
|
||||
|
||||
# "$@" passes every parameter seperately quoted, "$*" passes all parameters as one quoted parameter.
|
||||
getparams "$@"
|
||||
get_parameters "$@"
|
||||
|
||||
# If no colorscheme was set in the parameter handling routine, then set the default scheme
|
||||
if ! ((CSCHEME))
|
||||
|
@ -715,7 +723,10 @@ END {
|
|||
')
|
||||
|
||||
#grep -oE '\<(nx|lm|sse[0-9]?|pni|svm|vmx)\>' | tr '\n' ' '))
|
||||
[[ -z $CPUFLAGS ]] && CPUFLAGS="-"
|
||||
if [[ -z $CPUFLAGS ]]
|
||||
then
|
||||
CPUFLAGS="-"
|
||||
fi
|
||||
|
||||
for I in /proc/ide/ide*/hd*
|
||||
do
|
||||
|
@ -754,9 +765,11 @@ then
|
|||
}
|
||||
}
|
||||
}
|
||||
' /proc/scsi/scsi)); IFS="$OIFS"
|
||||
' /proc/scsi/scsi))
|
||||
IFS="$OIFS"
|
||||
|
||||
for ((I=0;I<${#THDD[@]};I++)); do
|
||||
for (( I=0; I < ${#THDD[@]}; I++ ))
|
||||
do
|
||||
HDDMOD="${HDDMOD}${HDDMOD+,}${THDD[I]}"
|
||||
done
|
||||
fi
|
||||
|
@ -954,7 +967,9 @@ then
|
|||
|
||||
for ((I=1;I<${#CPU[@]}-1;I++))
|
||||
do
|
||||
IFS=","; CPUTMP=(${CPU[I]}); IFS="$OIFS"
|
||||
IFS=","
|
||||
CPUTMP=(${CPU[I]})
|
||||
IFS="$OIFS"
|
||||
LNCPU=$( printf "${C1}%-${INDENT}s${C2} %s" " " "($((I+1))) ${CPUTMP[0]}" )
|
||||
if [[ $VBL -ge 3 ]]
|
||||
then
|
||||
|
|
Loading…
Reference in a new issue