diff --git a/scripts/getInfo b/scripts/getInfo index d6443b2..7b9e052 100755 --- a/scripts/getInfo +++ b/scripts/getInfo @@ -1,6 +1,6 @@ #!/bin/bash -version=2.10.2 +version=2.10.3 date="19/10/2017" projet="simpledeb" contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/" @@ -400,16 +400,18 @@ fi_disk(){ # 19/10/2017 text+="$(printf '%-17s: %s' "disque$pluriel fixe$pluriel" "$fget_disk_fixe") \n" [ "$(wc -w <<< $fget_disk_amov)" -gt 1 ] && pluriel="s" || unset pluriel text+="$(printf '%-17s: %s' "disque$pluriel amovible$pluriel" "$fget_disk_amov") \n\n" - # partitions fixes montées / non montées + # partitions fixes montées / swap / non montées [ "$(wc -w <<< $fget_disk_part_fixe_m)" -gt 1 ] && pluriel="s" || unset pluriel - text+="$(printf '%-17s: %s' "partition$pluriel fixe$pluriel montée$pluriel" "$fget_disk_part_fixe_m") \n" + text+="$(printf '%-24s: %s' "partition$pluriel fixe$pluriel montée$pluriel" "$fget_disk_part_fixe_m") \n" + [ "$(wc -w <<< $fget_disk_part_swap)" -gt 1 ] && pluriel="s" || unset pluriel + text+="$(printf '%-24s: %s' "partition$pluriel swap$pluriel" "$fget_disk_part_swap") \n" [ "$(wc -w <<< $fget_disk_part_fixe_nm)" -gt 1 ] && pluriel="s" || unset pluriel - text+="$(printf '%-17s: %s' "partition$pluriel fixe$pluriel non montée$pluriel" "$fget_disk_part_fixe_nm") \n\n" + text+="$(printf '%-28s: %s' "partition$pluriel fixe$pluriel non montée$pluriel" "$fget_disk_part_fixe_nm") \n\n" # partitions amovibles montées / non montées [ "$(wc -w <<< $fget_disk_part_amov_m)" -gt 1 ] && pluriel="s" || unset pluriel - text+="$(printf '%-17s: %s' "partition$pluriel amovible$pluriel montée$pluriel" "$fget_disk_part_amov_m") \n" + text+="$(printf '%-32s: %s' "partition$pluriel amovible$pluriel montée$pluriel" "$fget_disk_part_amov_m") \n" [ "$(wc -w <<< $fget_disk_part_amov_nm)" -gt 1 ] && pluriel="s" || unset pluriel - text+="$(printf '%-17s: %s' "partition$pluriel amovible$pluriel non montée$pluriel" "$fget_disk_part_amov_nm") \n\n" + text+="$(printf '%-32s: %s' "partition$pluriel amovible$pluriel non montée$pluriel" "$fget_disk_part_amov_nm") \n\n" # détails des disques text+="$fget_disk_detail \n" text+='``` \n\n' @@ -484,31 +486,31 @@ fi_dmesg(){ #v2 19/10/2017 dmesg_crit=$(sed -n 1,"$nb_lignes"p $file-crit) dmesg_err=$(sed -n 1,"$nb_lignes"p $file-err) dmesg_warn=$(sed -n 1,"$nb_lignes"p $file-warn) - [ "$dmesg_emerg" ] || dmesg_emerg="" - [ "$dmesg_alert" ] || dmesg_alert="" - [ "$dmesg_crit" ] || dmesg_crit="" - [ "$dmesg_err" ] || dmesg_err="" - [ "$dmesg_warn" ] || dmesg_warn="" + [ "$dmesg_emerg" ] || dmesg_emerg=" " + [ "$dmesg_alert" ] || dmesg_alert=" " + [ "$dmesg_crit" ] || dmesg_crit=" " + [ "$dmesg_err" ] || dmesg_err=" " + [ "$dmesg_warn" ] || dmesg_warn=" " rm "$file-"* ### text="## dmesg kernel (emergency, alerte, erreur, warning ou critique) \n\n" - text+='`dmesg -l emerg`'" (emergency, $nb_lignes premières lignes) \n" + text+='`dmesg -l emerg`'" (**emergency**, $nb_lignes premières lignes) \n" text+='```\n' text+="$dmesg_emerg \n" text+='```\n\n' - text+='`dmesg -l alert`'" (alerte, $nb_lignes premières lignes) \n" + text+='`dmesg -l alert`'" (**alerte**, $nb_lignes premières lignes) \n" text+='```\n' text+="$dmesg_alert \n" text+='```\n\n' - text+='`dmesg -l crit`'" (critique, $nb_lignes premières lignes) \n" + text+='`dmesg -l crit`'" (**critique**, $nb_lignes premières lignes) \n" text+='```\n' text+="$dmesg_crit \n" text+='```\n\n' - text+='`dmesg -l err`'" (erreur, $nb_lignes premières lignes) \n" + text+='`dmesg -l err`'" (**erreur**, $nb_lignes premières lignes) \n" text+='```\n' text+="$dmesg_err \n" text+='```\n\n' - text+='`dmesg -l warn`'" (warning, $nb_lignes premières lignes) \n" + text+='`dmesg -l warn`'" (**warning**, $nb_lignes premières lignes) \n" text+='```\n' text+="$dmesg_warn \n" text+='```\n\n' @@ -591,49 +593,49 @@ fi_journal(){ # 19/10/2017 jctl_crit_k=$(sed '/kernel:/!d' $file-crit | sed -n 1,"$nb_lignes"p) jctl_err_k=$(sed '/kernel:/!d' $file-err | sed -n 1,"$nb_lignes"p) jctl_warn_k=$(sed '/kernel:/!d' $file-warn | sed -n 1,"$nb_lignes"p) - [ "$jctl_alert_k" ] || jctl_alert_k="" - [ "$jctl_crit_k" ] || jctl_crit_k="" - [ "$jctl_err_k" ] || jctl_err_k="" - [ "$jctl_warn_k" ] || jctl_warn_k="" - jctl_alert_nok=$(sed '/kernel:/d; s/-- No entries --//' $file-alert | sed -n 1,"$nb_lignes"p) - jctl_crit_nok=$(sed '/kernel:/d; s/-- No entries --//' $file-crit | sed -n 1,"$nb_lignes"p) - jctl_err_nok=$(sed '/kernel:/d; s/-- No entries --//' $file-err | sed -n 1,"$nb_lignes"p) - jctl_warn_nok=$(sed '/kernel:/d; s/-- No entries --//' $file-warn | sed -n 1,"$nb_lignes"p) + [ "$jctl_alert_k" ] || jctl_alert_k=" " + [ "$jctl_crit_k" ] || jctl_crit_k=" " + [ "$jctl_err_k" ] || jctl_err_k=" " + [ "$jctl_warn_k" ] || jctl_warn_k=" " + jctl_alert_nok=$(sed '/kernel:/d; s/-- No entries --/ /' $file-alert | sed -n 1,"$nb_lignes"p) + jctl_crit_nok=$(sed '/kernel:/d; s/-- No entries --/ /' $file-crit | sed -n 1,"$nb_lignes"p) + jctl_err_nok=$(sed '/kernel:/d; s/-- No entries --/ /' $file-err | sed -n 1,"$nb_lignes"p) + jctl_warn_nok=$(sed '/kernel:/d; s/-- No entries --/ /' $file-warn | sed -n 1,"$nb_lignes"p) rm "$file-"* ### # kernel text="## journalctl kernel (emergency, alert, erreur, warning ou critique) \n\n" - text+='`journalctl --no-hostname --boot 0 -k -p 1`'" (emergency 0 & alerte 1, $nb_lignes premières lignes) \n" + text+='`journalctl --no-hostname --boot 0 -k -p 1`'" (**kernel emergency 0 & alerte 1**, $nb_lignes premières lignes) \n" text+='```\n' text+="$jctl_alert_k \n" text+='```\n\n' - text+='`journalctl --no-hostname --boot 0 -k -p 2..2`'" (critique, $nb_lignes premières lignes) \n" + text+='`journalctl --no-hostname --boot 0 -k -p 2..2`'" (**kernel critique**, $nb_lignes premières lignes) \n" text+='```\n' text+="$jctl_crit_k \n" text+='```\n\n' - text+='`journalctl --no-hostname --boot 0 -k -p 3..3`'" (erreur, $nb_lignes premières lignes) \n" + text+='`journalctl --no-hostname --boot 0 -k -p 3..3`'" (**kernel erreur**, $nb_lignes premières lignes) \n" text+='```\n' text+="$jctl_err_k \n" text+='```\n\n' - text+='`journalctl --no-hostname --boot 0 -k -p 4..4`'" (warning, $nb_lignes premières lignes) \n" + text+='`journalctl --no-hostname --boot 0 -k -p 4..4`'" (**kernel warning**, $nb_lignes premières lignes) \n" text+='```\n' text+="$jctl_warn_k \n" text+='```\n\n' # non kernel text+="## journalctl hors kernel (emergency, alert, erreur, warning ou critique) \n\n" - text+='`journalctl --no-hostname --boot 0 -p 1 | grep -v kernel:`'" (emergency 0 & alerte 1, $nb_lignes premières lignes) \n" + text+='`journalctl --no-hostname --boot 0 -p 1 | grep -v kernel:`'" (**hors kernel emergency 0 & alerte 1**, $nb_lignes premières lignes) \n" text+='```\n' text+="$jctl_alert_nok \n" text+='```\n\n' - text+='`journalctl --no-hostname --boot 0 -p 2..2 | grep -v kernel:`'" (critique, $nb_lignes premières lignes) \n" + text+='`journalctl --no-hostname --boot 0 -p 2..2 | grep -v kernel:`'" (**hors kernel critique**, $nb_lignes premières lignes) \n" text+='```\n' text+="$jctl_crit_nok \n" text+='```\n\n' - text+='`journalctl --no-hostname --boot 0 -p 3..3 | grep -v kernel:`'" (erreur, $nb_lignes premières lignes) \n" + text+='`journalctl --no-hostname --boot 0 -p 3..3 | grep -v kernel:`'" (**hors kernel erreur**, $nb_lignes premières lignes) \n" text+='```\n' text+="$jctl_err_nok \n" text+='```\n\n' - text+='`journalctl --no-hostname --boot 0 -p 4..4 | grep -v kernel:`'" (warning, $nb_lignes premières lignes) \n" + text+='`journalctl --no-hostname --boot 0 -p 4..4 | grep -v kernel:`'" (**hors kernel warning**, $nb_lignes premières lignes) \n" text+='```\n' text+="$jctl_warn_nok \n" text+='```\n\n' @@ -701,7 +703,7 @@ fi_log_xorg(){ #v2 19/10/2017 extract="$(grep -Es '\(WW\)|\(EE\)|\(\?\?\)' $xfile | sed '/(WW) warning, (EE) error,/d')" extract="$(sed -n 1,"$nb_lignes"p <<< $extract)" if [ "$extract" ]; then - logXorg+="$xfile (WW) warning, (EE) erreur, (??) inconnu, $nb_lignes premières lignes maxi \n\n" + logXorg+="$xfile (WW) **warning**, (EE) **erreur**, (??) inconnu, $nb_lignes premières lignes maxi \n\n" logXorg+="$(grep -E '\(EE\)' <<< $extract) \n" logXorg+="$(grep -E '\(WW\)' <<< $extract) \n\n" else @@ -781,7 +783,7 @@ fi_nonFree(){ # 25/09/2017 echo -e "$text" >> "$fileOutput" } -fi_reseau(){ # 17/10/2017 +fi_reseau(){ # 19/10/2017 local slotNetCards netCards ip_a iwconfig interfaces route resolv liste_canaux_wifi inet text # netCards="$(lspci -nnk | grep -iEA 5 'network|ethernet')" # netCards="$(lspci -nnv | grep -iEA 15 'network|ethernet')" @@ -834,10 +836,12 @@ fi_reseau(){ # 17/10/2017 text+='```\n' text+="$gateways \n" text+='```\n\n' - text+="**interface prioritaire** \n" - text+='```\n' - text+="$if_prioritaire \n" - text+='```\n\n' + if [ "$(wc -w <<< $ifnames)" -gt 1 ]; then # si plus d'une interface réseau + text+="**interface prioritaire** \n" + text+='```\n' + text+="$if_prioritaire \n" + text+='```\n\n' + fi text+='`ip address`'" (sans ipV6 et sans adresses MAC) \n" text+='```\n' text+="$ip_a \n" @@ -1286,10 +1290,11 @@ figet_de(){ # thanks neofetch, assigne $fget_de #14/10/2017 # $fget_disk_fixe : liste devices block fixes, $fget_disk_amov : liste devices block amovibles # $fget_disk_part_fix_tot : espace des partitions fixes montées # $fget_disk_ata, $fget_disk_usb, $fget_disk_mmc, $fget_disk_nvme : liste disk ata, usb... - # $fget_disk_part_fixe_nm, $fget_disk_part_amov_nm : liste partitions non montées, fixes ou amovibles # $fget_disk_part_fixe_m, $fget_disk_part_amov_m : liste partitions montées, fixes ou amovibles + # $fget_disk_part_swap : liste partitions swap + # $fget_disk_part_fixe_nm, $fget_disk_part_amov_nm : liste partitions non montées, fixes ou amovibles figet_disk(){ #v2 19/10/2017 - local size type vendor_model serial_rev list_id idisk + local size type vendor_model serial_rev list_id idisk lsblk # détail disques, séquence disques fixes et amovibles unset fget_disk_fixe fget_disk_amov fget_disk_detail="$(printf '%-5s %-8s %-6s %-24s %-26s' "disk" "taille" "type" "vendeur modèle" " n° série révision")"$'\n' @@ -1315,14 +1320,19 @@ figet_disk(){ #v2 19/10/2017 # nb de disques, peut servir d'indicateur fonction déja appelée fget_nb_disk="$(tr ' ' '\n' <<< "$fget_disk_fixe $fget_disk_amov" | grep -c .)" # séquences partitions fixes, montées (m) et non montées (nm) - fget_disk_part_fixe_m="$(lsblk -no KNAME,MOUNTPOINT $(printf '/dev/%s ' $fget_disk_fixe) 2>/dev/null | gawk '/\// {print $1}' | tr '\n' ' ')" - fget_disk_part_fixe_nm="$(lsblk -no KNAME,MOUNTPOINT $(printf '/dev/%s ' $fget_disk_fixe) 2>/dev/null | gawk '!/\// && /[0-9]+/ {print $1}' | tr '\n' ' ')" + lsblk="$(lsblk -no KNAME,MOUNTPOINT $(printf '/dev/%s ' $fget_disk_fixe) 2>/dev/null)" + fget_disk_part_fixe_m="$(echo "$lsblk" | gawk '/\// {print $1}' | tr '\n' ' ')" + fget_disk_part_fixe_nm="$(echo "$lsblk" | gawk '!/\// && /[0-9]+/ && !/\[SWAP\]/{print $1}' | tr '\n' ' ')" # séquences partitions amovibles, montées (m) et non montées (nm) - fget_disk_part_amov_m="$(lsblk -o KNAME,MOUNTPOINT $(printf '/dev/%s ' $fget_disk_amov) 2>/dev/null | gawk '/\// {print $1}' | tr '\n' ' ')" - fget_disk_part_amov_nm="$(lsblk -o KNAME,MOUNTPOINT $(printf '/dev/%s ' $fget_disk_amov) 2>/dev/null | gawk '!/\// && /[0-9]+/ {print $1}' | tr '\n' ' ')" + lsblk="$(lsblk -no KNAME,MOUNTPOINT $(printf '/dev/%s ' $fget_disk_amov) 2>/dev/null)" + fget_disk_part_amov_m="$(echo "$lsblk" | gawk '/\// {print $1}' | tr '\n' ' ')" + fget_disk_part_amov_nm="$(echo "$lsblk" | gawk '!/\// && /[0-9]+/ && !/\[SWAP\]/{print $1}' | tr '\n' ' ')" + # partitions swap + fget_disk_part_swap="$(echo "$(lsblk -no KNAME,MOUNTPOINT)" | gawk '/\[SWAP\]/ {print $1}' | tr '\n' ' ')" [ "$fget_disk_fixe" ] || fget_disk_fixe="-" [ "$fget_disk_amov" ] || fget_disk_amov="-" [ "$fget_disk_part_fixe_m" ] || fget_disk_part_fixe_m="-" + [ "$fget_disk_part_swap" ] || fget_disk_part_swap="-" [ "$fget_disk_part_fixe_nm" ] || fget_disk_part_fixe_nm="-" [ "$fget_disk_part_amov_m" ] || fget_disk_part_amov_m="-" [ "$fget_disk_part_amov_nm" ] || fget_disk_part_amov_nm="-" @@ -2085,7 +2095,7 @@ for j in $options; do case $j in -t | --test ) prg_1 "$*" - fi_log_xorg + fi_reseau prg_3 exit ;; # test seulement -c* | all ) diff --git a/scripts/getInfo_changelog.md b/scripts/getInfo_changelog.md index bc96e05..d675f67 100644 --- a/scripts/getInfo_changelog.md +++ b/scripts/getInfo_changelog.md @@ -8,20 +8,22 @@ * figet_cpu, refaire * bug temp cpu (neofetch) * filtrer temperature 0 (sur i5: 6temp!) + --- * f__requis f__wget_test fscript_get_version fscript_update fscript_cronAnacron -## 2.10.2 19/10/2017 +## 2.10.3 19/10/2017 * nouveau: fi_journal, journaux kernel et non-kernel via journalctl, dmesg en fallback, x premières lignes -* nouveau: fi_disk, ajout listes partitions fixes/amovibles, montées/non montées -* révision: figet_disk, tris des listes de disques par type +* nouveau: fi_disk, ajout listes partitions fixes/amovibles, montées/non montées, swap +* révision: figet_disk, tris des listes de disques par type, partition swap, swap sorti partitions non montées * révision: fi_dmesg, , x premières lignes * révision: suppression option --dmesg, journaux via option -ca (fi_system_analyse fi_log_xorg fi_journal) + option -j * révision: fi_log_xorg, trié par error ou warning, juste .0.log, x premières lignes -* fi_nonFree passsé en catégorie configuration (-cc), option équivalente -j +* révision: fi_nonFree passsé en catégorie configuration (-cc), option équivalente -j +* révision: fi_reseau, affichage interface réseau prioritaire SI plusieurs interfaces * fix: fi_dmesg, niveau emergency & alerte oublié * fix: partitions en liste