getInfo 2.51.1

This commit is contained in:
kyodev 2017-12-01 22:37:47 +01:00
parent 440d9786c5
commit 0c4b58eb07
2 changed files with 21 additions and 11 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
version=2.51.0
version=2.51.1
date="01/12/2017"
projet="simpledeb"
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
@ -1889,7 +1889,7 @@ fi_system(){ # 01/12/2017
charge=${charge//, / } # remplacement global ', ' par ' '
charge=${charge//,/.} # remplacement global , par .
uptime=${uptime%%, *} # uptime -p parfois inexistant (alpine), suppression à la fin de ',[blancs]*' -> conservation premier 'champs' ifs ', '
uptime=${uptime/*up /depuis } # suppression début jusqu'à 'up '
uptime=${uptime/*up } # suppression jusqu'à 'up '
uptime=${uptime//weeks/semaines} # remplacement global
uptime=${uptime//week/semaine} # remplacement global
uptime=${uptime//days/jours} # remplacement global
@ -1936,9 +1936,10 @@ fi_system(){ # 01/12/2017
f_pr l2 "boot $mbr"
f_pr l2 "architecture système: $architecture"
f_pr l2 "date d'installation: $date_install"
f_pr l2 "démon d'initialisation: $initDaemon"
f_pr l2 "démon d'initialisation: $initDaemon"
f_pr l2 "shell actif: $fg_shell"
f_pr l2 "shells installés: $fg_shells"
[ $( f__wcv -w ) ] && pluriel="s" || unset pluriel
f_pr l2 "shell"$pluriel" installé"$pluriel": $fg_shells"
f_pr l2 "$bootImage"
f_pr
f_pr l1 "Environnement"
@ -1954,18 +1955,20 @@ fi_system(){ # 01/12/2017
f_pr l2 "window manager: $fg_wm"
f_pr
f_pr l1 "Matériel"
f_pr l2 "processeur $fg_cpu_arch"
[ "$fg_nb_cpu" -gt 1 ] && pluriel="s" || unset pluriel
f_pr l2 "$fg_nb_cpu processeur"$pluriel" $fg_cpu_arch"
[ "$fe_nb_bluez" -gt 1 ] && pluriel="s" || unset pluriel
f_pr l2 "$fe_nb_bluez carte"$pluriel" bluetooth ($fe_cards_bluez)" '[ "$fe_nb_bluez" -gt 0 ]'
f_pr l2 "$alimentation" '[ "$alimentation" ]'
[ "$fg_nb_batt" -gt "1" ] && pluriel="s" || unset pluriel
f_pr l2 "$fg_nb_batt batterie"$pluriel" présente$pluriel:" '[ "$fg_batt" ]'
f_pr l2 "$fg_nb_batt batterie"$pluriel" présente"$pluriel":" '[ "$fg_batt" ]'
f_pr l3 "$(sed -n '1p' <<< $fg_batt)" '[ "$fg_batt" ]'
f_pr l '```'
f_pr
f_pr 1 "$( sed -E 's/^(.*: )(.*)/\1**\2**/' <<<$fg_disk_part_fix_tot )" '[ "$fg_disk_part_fix_tot" ]'
f_pr 1 "dernier boot: **$lastboot**, uptime: **$uptime**"
f_pr 1 "charge système depuis les 1, 5 et 15 dernières minutes: **$charge** ($fg_nb_threads threads)"
f_pr 1 "dernier boot: **$lastboot**, il y a **$uptime**"
[ "$fg_nb_threads" -gt "1" ] && pluriel="s" || unset pluriel
f_pr 1 "charge système depuis les 1, 5 et 15 dernières minutes: **$charge** ($fg_nb_threads thread"$pluriel")"
f_pr flush
}
@ -2177,8 +2180,8 @@ figet_batt(){ #v2 11/11/2017
[ "$(xargs <<< $fg_batt_serial)" ] || fg_batt_serial+="n/a"
}
# assigne $fg_cpu (3 lignes description cpu), fg_nb_threads, $fg_cpu_arch, $fg_uarch, $fg_vendor=AMD|Intel
figet_cpu(){ #v2 29/11/2017
# assigne $fg_cpu (description cpu), fg_nb_threads, $fg_cpu_arch, $fg_uarch, $fg_vendor=AMD|Intel, $fg_nb_cpu
figet_cpu(){ #v2 1/12/2017
local cpuinfo speedNom speedMax speedMin speedCpu descrCpu cpu1 cpu2 cpu3
cpuinfo="$(cat /proc/cpuinfo)"
# speed
@ -2204,6 +2207,12 @@ figet_cpu(){ #v2 29/11/2017
[ "$speedCpu" ] && speedCpu=$(printf "%sGHz" $speedCpu)
[ "$speedCpu" ] || speedCpu=$(gawk -F '@' '/model name/ {sub(/^ | $/,"",$2); print $2;exit}' <<< "$cpuinfo")
# motifs?: Processor Dual-Core Quad-Core Six-Core Eight-Core Core 'with Radeon * Graphics'
# nb proc
fg_nb_cpu=$(
gawk -F ':|@' '
/^physical id/ { if ($2+1 != nbCpu) nbCpu=$2+1 }
END { printf nbCpu}
' <<< "$cpuinfo" )
# traitement fg_cpu
cpu1=$(
gawk -v "speedCpu=$speedCpu" -F ':|@' '

View File

@ -5,13 +5,14 @@
## 2.51.0 01/12/2017
## 2.51.1 01/12/2017
* nouveau: f_pr, f_di nouveau marquage pour construction rapport MD
* révision: fi_systeme, version Xserveur X.org, suppression alert_SLiM
* révision: alert ucode dans fi_cpu
* révision: fi_audio, fi_bluez, fi_disk, fi_vrms
* révision: général, bascule sur f_pr, f_di
* révision: figet_cpu, nb de cpu
* nettoyage: suppression des tests
## 2.50.3 30/11/2017