getInfo 2.66.2

This commit is contained in:
kyodev 2017-12-15 01:18:35 +01:00
parent 708254bc73
commit 1244c697c4
2 changed files with 264 additions and 250 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
version=2.66.1
version=2.66.2
date="14/12/2017"
projet="simpledeb"
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
@ -514,10 +514,10 @@ toDisplay=(
echo -e "$STD\n plus d'infos: $GREEN$urlNotice\n$STD"
}
# f_prnt "1||2|3|l1|l2|l3|titre1|titre2|titre3|hl|quote|flush|code" "texte" '[CONDITION test]'
# f_prnt "1||2|3|l1|l2|l3|tit1|tit2|tit3|hl|quote|flush|code" "texte" '[CONDITION test]'
# $1: 1|2|3 indentation, liste à puce, une puce par ligne
# l1|l2|l3 ligne, indentation, avec espaces
# titre1|titre2|titre3
# tit1|tit2|tit3
# quote|hl|flush
# $2 texte à afficher
# $3 test éventuel, Si CONDITION ok -> affichage
@ -529,9 +529,9 @@ f_prnt(){ # 11/12/2017
local preline='' line='' endline=" \n"
[[ "$1" =~ titre ]] && preline="\n\n"
[[ "$1" == 'titre1' ]] && preline+="# "
[[ "$1" == 'titre2' ]] && preline+="## "
[[ "$1" == 'titre3' ]] && preline+="### "
[[ "$1" == 'tit1' ]] && preline+="# "
[[ "$1" == 'tit2' ]] && preline+="## "
[[ "$1" == 'tit3' ]] && preline+="### "
[[ "$1" =~ titre ]] && endline+="\n"
[[ "$1" == '1' ]] && line="$( sed -E 's/(.*)/* \1 /' <<<$2 )"
[[ "$1" == '2' ]] && line="$( sed -E 's/(.*)/ * \1 /' <<<$2 )"
@ -687,8 +687,8 @@ fi_audio(){ # 14/12/2017
cmt_modAudio="$( f__wcv -wv "$modAudio" "^[[:alnum:]]" ) module"$pluriel" utilisé"$pluriel
fi
###
f_prnt titre2 "audio"
f_prnt l "$(sed -E 's/(.*)/**\1** /' <<< $fe_cards_audio)" # en gras
f_prnt tit2 "audio"
f_prnt 1 "$( sed -E 's/(.*)/**\1** /' <<< $fe_cards_audio )" # en gras
f_prnt
# lspci -nnv
f_dspl cmd "$cardsAudio" "$cmd_cards"
@ -706,7 +706,7 @@ fi_batt(){ # 14/12/2017
[ "$fg_batt" ] || return 0 # pas de batterie
[ "$fg_nb_batt" -gt 1 ] && pluriel="s" || unset pluriel
###
f_prnt titre2 "batterie"$pluriel
f_prnt tit2 "batterie"$pluriel
f_dspl sans "$fg_batt"
}
@ -739,7 +739,7 @@ fi_bluez(){ # 14/12/2017
cmt_mod="$( f__wcv -l "$mod" ) module"$pluriel" utilisé"$pluriel
fg_mod_motif=${fg_mod_motif//|/ } # fg_mod_motif motif de recherche, avec |
###
f_prnt titre2 "Bluetooth"
f_prnt tit2 "Bluetooth"
f_dspl cmd "$bluez" "$cmd_bluez" "$cmt_bluez"
f_dspl cmd "$mod" "$cmd_mod" "$cmt_mod"
[ "$mod" ] || f_dspl sans "$fg_mod_motif" "" "pas de modules en mémoire parmi:"
@ -770,7 +770,7 @@ fi_conf(){ # 13/12/2017
confs=$( f_grep_file "${toScrut[*]}" "noinexist" )
###
f_prnt titre2 "fichiers configuration divers"
f_prnt tit2 "fichiers configuration divers"
f_dspl cmd "$confs" "grep -Ersv '^#|^$' <fichiers désirés>"
}
@ -801,7 +801,7 @@ fi_cpu(){ # 14/12/2017
[ "$(( ${fg_cpu:0:1} ))" -gt 1 ] && pluriel="s" || unset pluriel
unset CPU_FLAGS x_cpu_flags
###
f_prnt titre2 "processeur"$pluriel
f_prnt tit2 "processeur"$pluriel
f_dspl cmd "$fg_cpu" "lscpu" # affichage proc
f_dspl var "$fg_uarch" "µarchitecture processeur"
f_dspl_alrt "$alert_microcode" "info"
@ -866,11 +866,11 @@ fi_disk(){ # 14/12/2017
fi
[ "$fg_nb_disk" -gt 1 ] && pluriel="s" || unset pluriel
###
f_prnt titre2 "disque"$pluriel
f_prnt tit2 "disque"$pluriel
# espace des partitions fixes montées
f_prnt 1 "$(gawk -F': ' '{print $1": **"$2"**"}' <<< $fg_disk_part_fix_tot)"
f_prnt
f_prnt l '```'
f_prnt code
# disques fixes et amovibles
[ "$(wc -w <<< $fg_disk_fixe)" -gt 1 ] && pluriel="s" || unset pluriel
f_prnt l "$(printf '%-17s: %s' "disque$pluriel fixe$pluriel" "$fg_disk_fixe")"
@ -893,14 +893,14 @@ fi_disk(){ # 14/12/2017
f_prnt
# détails des disques par type
f_prnt l "$fg_disk_table"
f_prnt l '```'
f_prnt code
f_prnt
[ "$fg_nb_disk" -gt 1 ] && pluriel="s" || unset pluriel
f_prnt 1 "**types de disque"$pluriel"** "
f_prnt
f_prnt l "| sata | usb | mmc | nvme |"
f_prnt l "| :---: | :---: | :---: | :---: |"
f_prnt l "| $fg_disk_ata | $fg_disk_usb | $fg_disk_mmc | $fg_disk_nvme |"
f_prnt l1 "| sata | usb | mmc | nvme |"
f_prnt l1 "| :---: | :---: | :---: | :---: |"
f_prnt l1 "| $fg_disk_ata | $fg_disk_usb | $fg_disk_mmc | $fg_disk_nvme |"
f_prnt
# éventuellement hddtemp
f_dspl cmd "$dd_temp" "$cmd_dd_temp" "température disque"$pluriel
@ -958,7 +958,7 @@ fi_dmesg(){ # 2/12/2017
# suppression fichier de transfert
rm "$file-"*
###
f_prnt titre2 "dmesg kernel (emergency, alerte, erreur, warning ou critique)"
f_prnt tit2 "dmesg kernel (emergency, alerte, erreur, warning ou critique)"
f_dspl cmd "$dmesg_emerg" "dmesg -l emerg" "emergency, $nb_lignes premières lignes"
f_dspl cmd "$dmesg_alert" "dmesg -l alert" "alerte, $nb_lignes premières lignes"
f_dspl cmd "$dmesg_crit" "dmesg -l crit" "critique, $nb_lignes premières lignes"
@ -979,7 +979,7 @@ fi_efi(){ # 6/12/2017
! /^Boot0/ { print $0 }
' <<< $( efibootmgr -v 2>/dev/null ) )
###
f_prnt titre2 "EFI boot"
f_prnt tit2 "EFI boot"
f_dspl cmd "$efiboot" "efibootmgr -v" "config EFI boot"
}
@ -1119,13 +1119,13 @@ fi_gpu(){ # 14/12/2017
# fonctions externes
(( x_screen )) || figet_screen
###
f_prnt titre2 "vidéo"
f_prnt l "$( sed -E 's/(.*)/**\1** /' <<< $fe_gpu )" # mise en gras
f_prnt tit2 "vidéo"
f_prnt 1 "$( sed -E 's/(.*)/**\1** /' <<< $fe_gpu )" # mise en gras
f_prnt
# nb écran & résolution(s) active(s)
f_prnt l "nombre d'écrans: **$fg_nb_screen**"
f_prnt 1 "nombre d'écrans: **$fg_nb_screen**"
[ "$( f__wcv "-wv" "$fg_resolution" "pixels" )" -gt 1 ] && pluriel="s" || unset pluriel
f_prnt l "résolution"$pluriel" active"$pluriel": **$fg_resolution**"
f_prnt 1 "résolution"$pluriel" active"$pluriel": **$fg_resolution**"
f_prnt
# lspci -nnv
f_dspl cmd "$cards" "$cmd_cards"
@ -1179,7 +1179,7 @@ fi_gpu_openGl(){ # 28/11/2017
fi_hw(){ # 14/12/2017
(( x_hw == 1 )) || figet_hw
###
f_prnt titre2 "hardware monitor"
f_prnt tit2 "hardware monitor"
f_dspl sans "$fg_hw" "sans"
f_prnt 1 "pas d'informations détectées" '[ -z "$fg_hw" ]'
f_prnt flush
@ -1272,7 +1272,7 @@ fi_journal(){ # 10/12/2017
# suppression fichier de transfert
rm "$file-"*
###
f_prnt titre2 "journalctl kernel (emergency, alert, erreur, warning ou critique)"
f_prnt tit2 "journalctl kernel (emergency, alert, erreur, warning ou critique)"
f_prnt 1 "**journaux persistants**" '[ -z "$alert_jctl_persist" ]'
f_prnt 1 "Début des log: **$jctl_boot**"
f_prnt
@ -1287,7 +1287,7 @@ fi_journal(){ # 10/12/2017
f_dspl cmd "$jctl_warn_k" "journalctl --no-hostname -b0 -k -p 4..4" \
"**kernel warning**, $nb_lignes premières lignes"
# journaux hors kernel
f_prnt titre2 "journalctl hors kernel (emergency, alert, erreur, warning ou critique)"
f_prnt tit2 "journalctl hors kernel (emergency, alert, erreur, warning ou critique)"
f_prnt 1 "Début des log: **$jctl_boot**"
f_prnt
f_dspl cmd "$jctl_alert_nok" "journalctl --no-hostname -b0 -p 1 | grep -v kernel" \
@ -1343,7 +1343,7 @@ fi_locale(){ # 10/12/2017
[ $( f__which setxkbmap ) ] && xKeyboardMap="$(setxkbmap -query)"
fi
###
f_prnt titre2 "localisation"
f_prnt tit2 "localisation"
# locale
f_dspl cmd "$localeConf" "grep -Esv '#|^$' /etc/default/locale* /etc/locale.conf"
f_dspl cmd "$localeCtl" "localectl status"
@ -1401,7 +1401,7 @@ fi_log_xorg(){ # 3/12/2017
cmd_logXorg="grep -Es '\(WW\)|\(EE\)|\(\?\?\)' $cmd_logXorg"
cmt_logXorg="Xorg.log"
###
f_prnt titre2 "journaux Xorg" "[ \"$1\" != \"notitre\" ]"
f_prnt tit2 "journaux Xorg" "[ \"$1\" != \"notitre\" ]"
f_dspl cmd "$logXorg" "$cmd_logXorg" "$cmt_logXorg"
f_dspl_alrt "$info_logs" "info"
}
@ -1415,7 +1415,7 @@ fi_mem(){ # 5/12/2017
memoire+="$fg_mem"
swappiness=$( cat /proc/sys/vm/swappiness 2>/dev/null )
###
f_prnt titre2 "mémoire"
f_prnt tit2 "mémoire"
f_dspl cmd "$memoire" "free -h"
f_dspl cmd "$swappiness" "cat /proc/sys/vm/swappiness" "Seuil bas de RAM libre où le swap est utilisé"
}
@ -1462,8 +1462,8 @@ fi_net(){ # 14/12/2017 ( matériel )
alert_wlx+="https://kyodev.frama.io/kyopages/trucs/interfaces-nommage-classique/"
fi
###
f_prnt titre2 "réseau"
f_prnt l "$(sed -E 's/(.*)/**\1** /' <<< $fe_cards_reseau)" # mise en gras
f_prnt tit2 "réseau"
f_prnt 1 "$( sed -E 's/(.*)/**\1** /' <<< $fe_cards_reseau )" # mise en gras
f_prnt
# lspci -nnv
f_dspl cmd "$cards" "$cmd_cards"
@ -1490,7 +1490,7 @@ fi_nm(){ # 5/12/2017
[ "$(f__wcv "-l" "$nm_wifis")" -eq 1 ] && unset nm_wifis
nm_connected=$( LC_ALL=C nmcli -f SSID,ACTIVE,IN-USE device wifi list | gawk '/yes[[:space:]]+\*/ {print $1}' )
###
f_prnt titre2 "NetworkManager"
f_prnt tit2 "NetworkManager"
f_dspl cmd "$nm_etat" "$cmd_nm_etat" "$cmt_nm_etat"
f_dspl cmd "$nm_conf" "$cmd_nm_conf" "$cmt_nm_conf"
f_dspl cmd "$nm_wifis" "$cmd_nm_wifis" "$cmt_nm_wifis"
@ -1789,7 +1789,7 @@ fi_pkg_apt(){ #v3 12/12/2017
cmd_kernel="dpkg -l | grep -i -E \"linux-(headers|image)-$(uname -r)\""
cmt_kernel="noyau"
###
f_prnt titre2 "gestion de paquets ${1#*:}"
f_prnt tit2 "gestion de paquets ${1#*:}"
f_prnt 1 "nombre de paquets installés: **$nb_packages**"
f_prnt 1 "dernière mise à jour apt: **$dateMaj**"
f_prnt 1 "version apt: **$apt_version**"
@ -1900,7 +1900,7 @@ fi_pkg_x(){ #v2 1/12/2017
[[ -z "$nb_packages" || "$nb_packages" -le 5 ]] && nb_packages="n/a"
[[ ${1#*:} == "Inconnue" ]] && unset nb_packages # totalement inconnu
###
f_prnt titre2 "gestion de paquets ${1#*:}"
f_prnt tit2 "gestion de paquets ${1#*:}"
f_dspl cmd:text "$nb_packages" "$cmd_nbPackages" "nombre de paquets installés"
f_dspl cmd "$sources" "$cmd_sources" "sources"
f_dspl cmd "$holded" "$cmd_holded" "paquets figés"
@ -1977,7 +1977,7 @@ fi_reseau(){ # 11/12/2017 ( configuration )
alert_slaac+="à vérifier si cet état est souhaité."
fi
###
f_prnt titre2 "configuration"
f_prnt tit2 "configuration"
f_prnt code
f_prnt l1 "ipv4"
f_prnt l2 "$ip4"
@ -2030,7 +2030,7 @@ fi_serial(){ #v9 1/12/2017
machineId=$( cat /etc/machine-id 2>/dev/null )
[ "$machineId" ] || machineId="n/a"
###
f_prnt titre1 "$BOLD""ID MAchine $BLUE$machineId$STD"
f_prnt tit1 "$BOLD""ID MAchine $BLUE$machineId$STD"
f_prnt
f_prnt 1 "$BOLD""N° Série:$STD"
f_prnt
@ -2057,7 +2057,7 @@ fi_ssid(){ #v2 11/12/2017
nm_ssid=$( f_grep_file "/etc/NetworkManager/system-connections/*" "lignevide" )
###
f__info "$RED""Attention:$BLUE la clé du réseau wifi est visible"
f_prnt titre1 "configuration(s) ssid networkmanager"
f_prnt tit1 "configuration(s) ssid networkmanager"
f_dspl cmd "$nm_ssid" "grep -Ersv '#|^$' /etc/NetworkManager/system-connections/*"
f_prnt flush
f_prnt_md "$fileOutput" "marge"
@ -2160,9 +2160,9 @@ fi_system(){ # 14/12/2017
# batterie(s)
enum_batt=$(grep -E '[A-Z][A-Z]' <<< $fg_batt)
###
[ "$ORIGIN" ] && f_prnt titre2 "système"
[ "$ORIGIN" ] && f_prnt tit2 "système"
f_prnt
f_prnt l "$( sed -E 's/(.*)/**\1** /' <<<$fg_dmi )" # en gras
f_prnt 1 "$( sed -E 's/(.*)/**\1** /' <<<$fg_dmi )" # en gras
f_prnt
f_prnt 1 "CPU"
f_prnt 2 "**$( sed -n '1p' <<< $fg_cpu )**"
@ -2176,7 +2176,7 @@ fi_system(){ # 14/12/2017
f_prnt 2 "$( sed -E 's/(.*)/**\1**/' <<<$fe_cards_audio )" '[ "$fe_cards_audio" ]'
f_prnt 2 "pas de carte réseau détectée" '[ "$fe_nb_audio" -eq 0 ]'
f_prnt
f_prnt l '```'
f_prnt code
f_prnt l1 "$fg_distrib"
f_prnt l2 "$uname"
f_prnt l2 "boot: $mbr"
@ -2211,7 +2211,7 @@ fi_system(){ # 14/12/2017
f_prnt l3 "$enum_batt" '[ "$fg_batt" ]'
[ "$fe_nb_touchpad" -gt "1" ] && pluriel="s" || unset pluriel
f_prnt l2 "$fe_nb_touchpad pavé"$pluriel" tactile"$pluriel": $fe_touchpad" '[ "fe_touchpad" ]'
f_prnt l '```'
f_prnt code
f_prnt
f_prnt 1 "$( sed -E 's/^(.*: )(.*)/\1**\2**/' <<<$fg_disk_part_fix_tot )" '[ "$fg_disk_part_fix_tot" ]'
f_prnt 1 "dernier boot: **$lastboot**, il y a **$uptime**"
@ -2282,7 +2282,7 @@ fi_system_analyse(){ #v 2/12/2017
cmd_bootGraph="systemd-analyze plot > $file ; xdg-open graph.svg"
cmt_bootGraph="graph durées et ordre de chargement des services"
###
f_prnt titre2 "analyse boot systemd"
f_prnt tit2 "analyse boot systemd"
f_prnt 1 "pas de service en erreur" '[ -z "$srvcFail" ]'
f_dspl cmd "$bootTime" "$cmd_bootTime" "$cmt_bootTime"
f_dspl cmd "$srvcFail" "$cmd_srvcFail" "$cmt_srvcFail"
@ -2295,7 +2295,7 @@ fi_system_analyse(){ #v 2/12/2017
# [$1=silent], assigne $fe_touchpad, fe_nb_touchpad
fi_touchpad(){ # 14/12/2017
local device cmd_device type type_pt pilote cmd_pilote cmt_pilote info_driver
local device cmd_device toScrut xfile file_logs type type_pt pilote cmd_pilote cmt_pilote info_driver
x_touchpad=1
device=$( grep -Ei -B1 -A8 'synap|alps|etps|elan' /proc/bus/input/devices ) || return 0
@ -2303,14 +2303,26 @@ fi_touchpad(){ # 14/12/2017
fe_touchpad=${fe_touchpad#*Name=\"} # suppression début
fe_touchpad=${fe_touchpad%\"} # suppression fin
cmd_device="grep -Ei -B1 -A8 'synap|alps|etps|elan' /proc/bus/input/devices"
type=$( grep -i 'touchpad: buttons:' /var/log/Xorg.0.log )
# recherche Xorg.log
toScrut=(
/var/log/Xorg.0.log
/home/$fu_user/.local/share/xorg/Xorg.0.log
/var/lib/gdm3/.local/share/xorg/Xorg.0.log
)
for xfile in ${toScrut[@]}; do
[ -e "$xfile" ] && file_logs+="$xfile "
done
[ "$file_logs" ] || file_logs="nologs"
if [ "$file_logs" != "nologs" ]; then
type=$( grep -is 'touchpad: buttons:' $file_logs )
# essai déterminer si multitouch
grep -iq 'left' <<< $type && type_pt="non multitouch"
grep -iq 'double' <<< $type && type_pt="2"
grep -iq 'triple' <<< $type && type_pt+="3"
if [ "$type_pt" ]; then
type_pt=" multitouch $type_pt points"
fi
grep -iq '[0-9]' <<< $type && type_pt=" multitouch $type_pt points"
type_pt=${type_pt/23/ 2\/3}
fe_touchpad+="$type_pt"
fi
fe_nb_touchpad=$( grep -ci 'touchpad' <<< "$fe_touchpad" )
[[ "$1" == "silent" ]] && return 0
@ -2326,7 +2338,9 @@ fi_touchpad(){ # 14/12/2017
info_driver+="pour voir les configurations personnalisées"
fi
###
f_prnt titre2 "Touchpad"
f_prnt 1 "$( sed -E 's/(.*)/**\1** /' <<< $fe_touchpad )" # mise en gras
f_prnt
f_prnt tit2 "Touchpad"
f_dspl cmd "$device" "$cmd_device"
f_dspl cmd "$pilote" "$cmd_pilote" "$cmt_pilote"
f_dspl_alrt "$info_driver" "info"
@ -2390,7 +2404,7 @@ fi_usb(){ # 14/12/2017
ls_p=${ls_p%[[:cntrl:]]}
IFS="$IFS_INI"
###
f_prnt titre2 "USB"
f_prnt tit2 "USB"
f_dspl cmd "$ls_p" "lsusb" "commande modifiée, ajout Class & Driver"
}
@ -2415,7 +2429,7 @@ fi_vrms(){ # 1/12/2017
vrms=$( sed -E "s/.*rms would be proud.*/$tempo/" <<< "$vrms" )
fi
###
f_prnt titre2 "paquets non-libres"
f_prnt tit2 "paquets non-libres"
f_dspl cmd "$vrms" "vrms" "détection des paquets non libres par RMS"
f_prnt flush
}
@ -4245,7 +4259,7 @@ for j in $options; do
ORIGIN='test'
prg_1 "$*"
echo -n "•"
fi_net
fi_touchpad
echo; f_prnt_md "$fileOutput"
exit ;; # test
-c* | all )

View File

@ -2,11 +2,12 @@
f__architecture
## getInfo 2.66.1 14/12/2017
## getInfo 2.66.2 14/12/2017
* nouveau: fi_usb, assemblage lsusb & lsusb -t
* nouveau: f_epure_marque, donc révision figet_dmi, figet_lspci
* fix: détection usb (fi_usb) et wlx (fi_net)
* fix: fi_touchpad, détection xorg.log inexistant sur wayland et buttons touchpad pas toujours présent dans les logs
## getInfo 2.65.0 14/12/2017
@ -14,7 +15,6 @@ f__architecture
* révision: figet_ip_pub
* révision: général, marqueur et appel fonction
## getInfo 2.64.0 13/12/2017
* révision: fi_bluez, détection device