From 7d0e5383150baaf7ee7941a0ee7ed32dcaa8412d Mon Sep 17 00:00:00 2001 From: kyodev Date: Sat, 28 Oct 2017 23:42:15 +0200 Subject: [PATCH] getInfo 2.19.6 --- scripts/getInfo | 29 +++++++++++++++-------------- scripts/getInfo_changelog.md | 5 ++++- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/scripts/getInfo b/scripts/getInfo index f2f3a4a..8fb2acb 100755 --- a/scripts/getInfo +++ b/scripts/getInfo @@ -1,6 +1,6 @@ #!/bin/bash -version=2.19.5 +version=2.19.6 date="28/10/2017" projet="simpledeb" contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/" @@ -413,8 +413,9 @@ fi_disk(){ # 29/10/2017 if [ -z "$resume" ]; then # alert resume absent resume="Pas de fichier _resume_ dans /etc/initramfs-tools/conf.d/ \n" - resume+="Ce n'est pas (forcément) une erreur. La plus grosse partition swap est choisie dans ce cas. " - resume+="À investiguer si erreur au boot ou boot très long." + resume+="Ce n'est pas (forcément) une erreur. \n" + resume+="La plus grosse partition swap est choisie dans ce cas. \n" + resume+="À investiguer si erreur au boot ou boot très long. \n" fi idResume="$(grep -Evs '^[[:blank:]]*#|^$' /etc/initramfs-tools/conf.d/resume | sed -En 's/.*UUID=([0-9a-Z-]*).*$/\1/p')" idSwap="$(grep -Ev '^[[:blank:]]*#|^$' /etc/fstab | sed -En 's/UUID=([0-9a-Z-]*).*swap.*$/\1/p')" @@ -794,20 +795,20 @@ fi_nm(){ # 29/10/2017 unset text } -fi_nonFree(){ # 25/09/2017 +fi_vrms(){ # 29/09/2017 local vrms text tempo tempo1 tempo2 pluriel - if [ "$(f__cmd_exist vrms)" ]; then - vrms="$(vrms)" - else - vrms="les paquets non-free ou contrib ne peuvent être détectés sans l'installation de vrms" - fi + [ "$(f__cmd_exist vrms)" ] && vrms="$(vrms)" ### # tempo1=$(grep -o '.*non-free packages' <<< "$vrms" | xargs) # tempo2=$(grep -o '.*contrib packages' <<< "$vrms" | xargs) # tempo=$(( ${tempo1:0:1} + ${tempo2:0:1} )) # [[ "$tempo1" && "$tempo" -gt 1 ]] && pluriel="s" || unset pluriel - text="## paquets$pluriel non-libres$pluriel \n\n" - f_display "vrms" "cmd" "vrms" + if [ "vrms" ]; then + text="## paquets$pluriel non-libres$pluriel \n\n" + f_display "vrms" "cmd" "vrms" + else + text+="* les paquets non-free ou contrib ne peuvent être détectés sans l'installation de vrms \n" + fi printf "$text\n" >> "$fileOutput" unset text } @@ -1106,7 +1107,7 @@ fi_usb(){ # 25/10/2017 } # informations batterie(s), assigne $fg_nb_batt $fg_batt -figet_batt(){ #v2 27/10/2017 +figet_batt(){ #v2 29/10/2017 local batt_detail batt_nb batt_unit batt_capa_design batt_capa_full batt_capa_now batt_conso local batt_volt_min batt_volt_now batt_status batt_cycle batt_sn alert_batt_alarm local batt_sante batt_restant tempo batRep ibat uevent @@ -1146,7 +1147,7 @@ figet_batt(){ #v2 27/10/2017 batt_volt_now="$(gawk -F '=' '/POWER_SUPPLY_VOLTAGE_NOW=/ {printf "%.2f", $2/1000000}' <<< $uevent)" # V batt_status="$(gawk -F '=' '/POWER_SUPPLY_STATUS=/ {print $2}' <<< $uevent)" batt_cycle="$(gawk -F '=' '/POWER_SUPPLY_CYCLE_COUNT=/ {print $2}' <<< $uevent)" - batt_sn="$(gawk -F '=' '/POWER_SUPPLY_SERIAL_NUMBER=/ {sub(/^ | $/,"",$2); print $2}' <<< $uevent)" + batt_sn="$(gawk -F '=' '/POWER_SUPPLY_SERIAL_NUMBER=/ {sub(/^ | $|0/,"",$2); print $2}' <<< $uevent)" alert_batt_alarm="$(cat $batRep/$ibat/alarm 2>/dev/null)" [ "$alert_batt_alarm" == "0" ] && unset alert_batt_alarm || alert_batt_alarm="$ibat: $alert_batt_alarm" # calculs @@ -2023,7 +2024,7 @@ prg_2(){ # traitements principaux fi if [[ "$1" == all || "$1" =~ c ]]; then #configuration #debian, packages -cc echo -e "# Configuration et packages \n\n" >> "$fileOutput" - for i in fi_locale fi_nonFree fi_sources ; do + for i in fi_locale fi_vrms fi_sources ; do $i printf "." done diff --git a/scripts/getInfo_changelog.md b/scripts/getInfo_changelog.md index 134e4f3..b61d6bf 100644 --- a/scripts/getInfo_changelog.md +++ b/scripts/getInfo_changelog.md @@ -7,15 +7,18 @@ * réseau réviser, interface name: virbr0, docker0 * revoir modules réseau * réviser alert_ +* finir révision vrms --- -## 2.19.5 28/10/2017 +## 2.19.6 28/10/2017 * nouveaux: avertissement erreur display :0 en root fedora beta ou buster * révision: message resume +* révision fi_nonFree renommé en fi_vrms + révision pas finie, plus de discrétion si absent * fi_nm: fix bug permission dans fedora NetworkManager.state * fix: figet_dmi, markdown +* figet_batt: s/n sur dell i5 ## 2.19.1 27/10/2017