getInfo 1.34.1

This commit is contained in:
kyodev 2017-10-05 06:37:22 +02:00
parent 4707cb8011
commit 903c3e373d
2 changed files with 17 additions and 22 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
version=1.34.0
version=1.34.1
date="04/10/2017"
projet="simpledeb"
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
@ -80,9 +80,9 @@ f__error() { # 22/09/2017
# conversion human, source ko, $1=nombre à convertir, affiche ko ou Mo ou Go
f__unit_human(){ # 04/10/2017
printf "$( awk ' {
if ( $1<1024 ) {unit="ko"; printf "%8d%s", $1, unit; exit}
if ( $1<1024*1024 && $1>=1024 ) {unit="Mo"; printf "%8d%s", $1/1024, unit}
else {unit="Go"; printf "%8.1f%s", $1/1024/1024, unit}
if ( $1<1024 ) {unit="ko"; printf "%d%s", $1, unit; exit}
if ( $1<1024*1024 && $1>=1024 ) {unit="Mo"; printf "%d%s", $1/1024, unit}
else {unit="Go"; printf "%.1f%s", $1/1024/1024, unit}
}' <<< $1 )"
}
@ -1163,8 +1163,8 @@ figet_mem(){ # 04/10/2017
local MemTotal MemFree MemAvailable Buffers Cached SReclaimable Shmem MemUsed SwapTotal SwapFree SwapCached col
while IFS=':' read a b; do
[ "$a" == "MemTotal" ] && MemTotal="${b/kB}" #echo "$a $((${b/kB}/1024))" ! partie entière !
[ "$a" == "MemFree" ] && MemFree="${b/kB}"
[ "$a" == "MemAvailable" ] && MemAvailable="${b/kB}"
[ "$a" == "MemFree" ] && MemFree="${b/kB}"
[ "$a" == "Buffers" ] && Buffers="${b/kB}"
[ "$a" == "Cached" ] && Cached="${b/kB}"
[ "$a" == "SReclaimable" ] && SReclaimable="${b/kB}"
@ -1178,25 +1178,25 @@ figet_mem(){ # 04/10/2017
totalTotal=$(( $MemTotal+$SwapTotal ))
totalUsed=$(( $MemUsed+$SwapUsed ))
totalAvailable=$(( $MemAvailable+$SwapFree ))
MemTotal=$(f__unit_human $MemTotal)
MemUsed=$(f__unit_human $MemUsed)
MemTotal=$( printf '%10s' $(f__unit_human $MemTotal) )
MemUsed=$( printf '%10s' $(f__unit_human $MemUsed) )
MemAvailable=$( printf '%10s' $(f__unit_human $MemAvailable) )
MemFree=$(f__unit_human $MemFree)
MemAvailable=$(f__unit_human $MemAvailable)
Buffers=$(f__unit_human $Buffers)
Cached=$(f__unit_human $Cached)
Cached=$(f__unit_human $SReclaimable)
Shmem=$(f__unit_human $Shmem)
SwapTotal=$(f__unit_human $SwapTotal)
SwapFree=$(f__unit_human $SwapFree)
SwapUsed=$(f__unit_human $SwapUsed)
SwapTotal=$( printf '%10s' $(f__unit_human $SwapTotal) )
SwapFree=$( printf '%10s' $(f__unit_human $SwapFree) )
SwapUsed=$( printf '%10s' $(f__unit_human $SwapUsed) )
SwapCached=$(f__unit_human $SwapCached)
totalTotal=$(f__unit_human $totalTotal)
totalUsed=$(f__unit_human $totalUsed)
totalAvailable=$(f__unit_human $totalAvailable)
totalTotal=$( printf '%10s' $(f__unit_human $totalTotal) )
totalUsed=$( printf '%10s' $(f__unit_human $totalUsed) )
totalAvailable=$( printf '%10s' $(f__unit_human $totalAvailable) )
unset fget_mem
if [[ ! "$*" =~ notitle ]]; then
[[ "$*" =~ nocoltitle ]] || col="mém.:"
fget_mem="$col totale utilisée disponible"$'\n'
fget_mem="$col totale utilisée disponible"$'\n'
fi
if [[ "$*" =~ mem ]]; then
[[ "$*" =~ nocoltitle ]] || col="ram :"
@ -1457,16 +1457,11 @@ prg_1(){ # début
echo -e "# $script sur $hote \n" > "$fileOutput"
echo -e "Rapport du $dateRapport -- [$script $version]($urlNotice) \n" >> "$fileOutput"
}
prg_2t(){ # traitements tests
printf " ."
fi_systeme; printf "."
fi_cpu; printf "."
fi_mem; printf "."
}
prg_2(){ # traitements principaux
printf " ."
fi_systeme; printf "."
fi_cpu; printf "."
fi_mem; printf "."
fi_graph; printf "."
fi_batt; printf "."
fi_localisation; printf "."

View File

@ -14,7 +14,7 @@
* comment f__user getInfo
## 1.34.0 04/10/2017
## 1.34.1 04/10/2017
* suppression figet_memory neofetch
* nouveau figet_mem