getInfo 2.38.0

This commit is contained in:
kyodev 2017-11-18 18:34:57 +01:00
parent 3b104e7e63
commit 0d3cbc5acc
2 changed files with 155 additions and 81 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
version=2.37.3
date="17/11/2017"
version=2.38.0
date="18/11/2017"
projet="simpledeb"
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
script="getInfo"
@ -376,7 +376,7 @@ f_dspl_alert(){ # 15/11/2017
# contrainte markdown:
# l'italique avec _ ou * n'est pas géré, trop d'interférences potentielles
# liste niveau2: 3 ou 4 caractères, niveau3: 6 ou 8 caractères, puce * ou -
f_dspl_md(){ # 11/11/2017
f_dspl_md(){ # 18/11/2017
local display display2 ifs_origin ligne
if [ ! -f "$1" ]; then
f__info "pas de rapport à afficher, vous devez lancer une analyse auparavant:" \
@ -406,9 +406,9 @@ f_dspl_md(){ # 11/11/2017
while [[ "$ligne" =~ (.*)\*{2}(.*)\*{2}(.*) ]]; do
ligne=${BASH_REMATCH[1]}'\x1B[1m'${BASH_REMATCH[2]}'\x1B(B\x1B[m'${BASH_REMATCH[3]}
done
# ` backtick mis en gras
# ` backtick en italique
while [[ "$ligne" =~ (.*)\`([^\`].*)\`(.*) ]]; do
ligne=${BASH_REMATCH[1]}'\x1B[1m'${BASH_REMATCH[2]}'\x1B(B\x1B[m'${BASH_REMATCH[3]}
ligne=${BASH_REMATCH[1]}'\x1B[3m'${BASH_REMATCH[2]}'\x1B(B\x1B[m'${BASH_REMATCH[3]}
done
# puces niveau 1
ligne=${ligne/#\*[^*]/• }
@ -796,7 +796,7 @@ SMCA ⟷ Scalable MCA
"
}
fi_disk(){ # 14/11/2017
fi_disk(){ # 18/11/2017
local dd_temp="" temp disk_df disk_df_i disk_lsblk fstab resume idResume idSwap idisk text pluriel
local alert_dd_temp alert_file_resume alert_uuidResume
# éventuellement hddtemp
@ -805,7 +805,7 @@ fi_disk(){ # 14/11/2017
[ -r "/dev/$idisk" ] || continue
temp=$(($( LC_ALL=C hddtemp -n /dev/$idisk 2>/dev/null)))
if [ "$temp" -ge 50 ]; then
alert_dd_temp+="$idisk: température > 50°C"$'\n'
alert_dd_temp+="$idisk: température > 50°C "$'\n'
fi
dd_temp+="$idisk: $temp °C"$'\n'
done
@ -821,19 +821,20 @@ fi_disk(){ # 14/11/2017
# fstab
fstab="$(f_grep_file "/etc/fstab" "nofile")"
# resume
resume="$(f_grep_file "/etc/initramfs-tools/conf.d/resume" "nofile")"
if [ -z "$resume" ]; then
resume=$( f_grep_file "/etc/initramfs-tools/conf.d/resume" "nofile" )
if [ "$resume" == "nofile" ]; then
# alert resume absent
alert_file_resume="Pas de fichier _resume_ dans /etc/initramfs-tools/conf.d/ \n"
alert_file_resume+="Ce n'est pas (forcément) une erreur, la plus grosse partition swap est "
alert_file_resume+="choisie dans ce cas. \n"
alert_file_resume+="À investiguer si erreur au boot ou boot très long."
alert_file_resume="Pas de fichier _resume_ dans /etc/initramfs-tools/conf.d/ \n"
alert_file_resume+="Ce n'est pas forcément une erreur, la plus grosse partition swap devrait être "
alert_file_resume+="choisie dans ce cas. \n"
alert_file_resume+="À investiguer si erreur au boot ou boot très long ou erreur update-initramfs. \n"
alert_file_resume+="Notes: <https://kyodev.frama.io/kyopages/debian/petits-soucis/#fichier-resume> \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')"
if [ "$idSwap" ] && [ "$idResume" ] && [ "$idSwap" != "$idResume" ]; then
alert_uuidResume+="vérifier la config resume, l'UUID ne correspond pas à celui du swap. \n"
alert_uuidResume+="id swap : $idSwap \nid resume: $idResume\n"
alert_uuidResume+="vérifier la config resume, l'UUID ne correspond pas à celui du swap. \n"
alert_uuidResume+="id swap : $idSwap \nid resume: $idResume \n"
alert_uuidResume+="vous pouvez utiliser _RESUME=auto_ ou _RESUME=/dev/sdx_, voir supprimer ce fichier"
fi
[ "$fg_nb_disk" ] || figet_disk
@ -965,7 +966,7 @@ fi_graph(){ # 13/11/2017
fi
cards=${cards::-1} # suppression dernier $'\n'
if grep -iq 'Unknown header type 7f' <<< "$cards" ; then
alert_hybrid="Une carte graphique semble désactivée actuellement, lspci n'est pas complet. \n"
alert_hybrid="Une carte graphique semble désactivée actuellement, lspci n'est pas complet. \n"
alert_hybrid+="Voir DRI_PRIME, vga-switcheroo, Bumbledee...?"
fi
# openGl / glxinfo
@ -1054,10 +1055,10 @@ fi_hw(){ # 10/11/2017
unset text
}
fi_journal(){ # 16/11/2017
fi_journal(){ # 18/11/2017
local jctl_boot jctl_alert_k jctl_crit_k jctl_err_k jctl_warn_k jctl_warn_nok jctl_last jctl_size file
local text nb_lignes=25
local alert_jctl_persist
local alert_jctl_persist alert_firmBug
[ "$(f__cmd_exist journalctl)" ] || fi_dmesg # pas systemd, appel dmesg
file="/tmp/$$-$RANDOM-journalctl"
[ "$EUID" -eq 0 ] || echo
@ -1111,6 +1112,11 @@ fi_journal(){ # 16/11/2017
jctl_last=$( sed '/-- Logs begin/d; s/-- No entries --/ ‣ vide/;s/<warn>//' $file-last )
# suppression fichier de transfert
rm "$file-"*
alert_firmBug=$( grep -i 'Firmware Bug' <<< $jctl_err_k )
if [ "$alert_firmBug" ]; then
alert_firmBug+="\n\n voir les microcodes? (chapitre système) \n"
alert_firmBug+="ou [wiki.debian.org/fr/Microcode](https://wiki.debian.org/fr/Microcode)"
fi
###
# kernel
text="## journalctl kernel (emergency, alert, erreur, warning ou critique) \n\n"
@ -1143,11 +1149,12 @@ fi_journal(){ # 16/11/2017
# dernières lignes
f_display "jctl_last" "cmd" "journalctl --no-pager --no-hostname --boot 0 -p 4 -n25" \
"toutes provenance, emergency-warning, $nb_lignes lignes les plus récentes"
f_dspl_alert "alert_firmBug" "alert"
printf "$text\n" >> "$fileOutput"
unset text
}
fi_locale(){ # 10/11/2017
fi_locale(){ # 18/11/2017
local locale localectl timezone timedatectl xKeyboardMap keyboard text
local alert_rtc alert_ntp
# locale
@ -1158,15 +1165,15 @@ fi_locale(){ # 10/11/2017
if [ "$(f__cmd_exist timedatectl)" ]; then
timedatectl="$(timedatectl status --no-pager)"
if grep -iq 'Network time on: no' <<< "$timedatectl"; then
alert_ntp="Network time on: no \n"
alert_ntp+="Le système ne synchronise pas l'heure sur un serveur NTP. Si ce n'est pas voulu: \n"
alert_ntp+="activer le service: timedatectl set-ntp true \n"
alert_ntp="Network time on: no \n"
alert_ntp+="Le système ne synchronise pas l'heure sur un serveur NTP. Si ce n'est pas voulu: \n"
alert_ntp+="activer le service: timedatectl set-ntp true \n"
alert_ntp+="et/ou installer le démon Ntp: apt install ntp"
fi
if grep -iq 'RTC in local TZ: yes' <<< "$timedatectl"; then
alert_rtc="RTC in local TZ: yes \n"
alert_rtc="RTC in local TZ: yes \n"
alert_rtc+="Lhorloge système doit être en UTC pour que les applications de date et "
alert_rtc+="heure fonctionnent correctement avec le fuseau horaire configuré sur le système. "
alert_rtc+="heure fonctionnent correctement avec le fuseau horaire configuré sur le système. \n"
alert_rtc+="Les modifications dheure dété/hiver peuvent être incohérentes quand lhorloge "
alert_rtc+="matérielle est en heure locale."
fi
@ -1260,8 +1267,8 @@ fi_nm(){ # 13/11/2017
}
fi_packager(){ #v2 17/11/2017
local alert_pkg_todo="ce gestionnaire de paquets n'est pas maîtrisé par manque d'expertise \n"
alert_pkg_todo+="vous êtes donc bienvenus à contribuer dans ce domaine: \n"
local alert_pkg_todo="ce gestionnaire de paquets n'est pas maîtrisé par manque d'expertise \n"
alert_pkg_todo+="vous êtes donc bienvenus à contribuer dans ce domaine: \n"
alert_pkg_todo+="https://framagit.org/kyodev/kyopages/blob/master/scripts/CONTRIB.md#getinfo"
if type -p dpkg &>/dev/null ; then # debian, buntu apt/dpkg
unset alert_pkg_todo # modèle, alert_pkg_todo pas implanté dans fi_pkg_apt
@ -1303,36 +1310,51 @@ fi_packager(){ #v2 17/11/2017
fi
}
fi_pkg_apt(){ #v3 17/11/2017
local sources ifile dateMaj nb_packages stock_upgd qte_upgradable upgrade comment_upgrade
local notUpgraded comment_notUpgraded toRemove qte_toRemove comment_toRemove
local non_ii qte_non_ii comment_non_ii etat ligne stock_etat deborphan qte_deborphan comment_deborphan
local holded qte_holded comment_holded info_update text pluriel
local alert_non_list alert_httpredir alert_upgrade alert_full_upgrade alert_remove alert_non_ii
local alert_deborphan
fi_pkg_apt(){ #v3 18/11/2017 qte comment cmd
local dateMaj nb_packages ifile info_update text pluriel
local sources comment_sources cmd_sources
local apt_prefs comment_apt_prefs cmd_apt_prefs
local stock_upgd qte_upgradable
local upgrade comment_upgrade cmd_upgrade
local notUpgraded comment_notUpgraded cmd_notUpgraded
local toRemove qte_toRemove comment_toRemove cmd_toRemove
local autoclean qte_autoclean comment_autoclean cmd_autoclean size_clean size_cleanH
local clean qte_clean comment_clean cmd_clean size_clean
local non_ii qte_non_ii comment_non_ii cmd_non_ii etat ligne stock_etat
local deborphan qte_deborphan comment_deborphan cmd_deborphan
local holded qte_holded comment_holded cmd_holded
local alert_non_list alert_httpredir alert_upgrade alert_full_upgrade alert_remove
local alert_autoclean alert_clean alert_non_ii alert_deborphan
# sources & divers
sources=$(f_grep_file "/etc/apt/sources.list /etc/apt/sources.list.d/*.list" 8)
dateMaj=$( date -r /var/cache/apt/pkgcache.bin '+%d/%m/%Y %H:%M %z' ) # /var/lib/dpkg/
nb_packages=$( dpkg -l | grep -c '^ii' )
sources=$( f_grep_file "/etc/apt/sources.list /etc/apt/sources.list.d/*.list" 8 )
comment_sources="dépôts"
cmd_sources="grep -Ersv '^#|^$' /etc/apt/sources.list /etc/apt/sources.list.d/*.list"
if [ $( ls -1 /etc/apt/sources.list.d/ | grep -cEv '\.list$' ) -gt 0 ]; then
for ifile in $( ls /etc/apt/sources.list.d/* ); do
[[ ${ifile##*.} != "list" ]] && alert_non_list+="$ifile: ignoré, extension non valable"
if [[ ${ifile##*.} != "list" ]]; then
alert_non_list+="$ifile: ignoré, extension non valable"
fi
done
fi
dateMaj="$(date -r /var/cache/apt/pkgcache.bin '+%d/%m/%Y %H:%M %z')" # /var/lib/dpkg/
nb_packages="$(dpkg -l | grep -c '^ii')"
if grep -iq 'httpredir' <<< $sources ; then
alert_httpredir="ces urls sont obsolètes, préférer http://deb.debian.org/ ou un miroir local: \n\n"
alert_httpredir="ces urls sont obsolètes, préférer http://deb.debian.org/ ou un miroir local: \n\n"
alert_httpredir+="$(grep 'httpredir' <<< "$sources")"
fi
apt_prefs=$( f_grep_file "/etc/apt/preferences.d/*" )
comment_apt_prefs="préférences apt"
cmd_apt_prefs="grep -Ersv '^#|^$' /etc/apt/preferences.d/"
printf "◇"
stock_upgd=$( LC_ALL=C apt-get upgrade --simulate )
# $1 upgraded, $6 to remove and $10 not upgraded
qte_upgradable=($(gawk '/ newly installed/{print $1" "$6" "$10}' <<< $stock_upgd)) # tableau
# => qte_upgradable [0]=upgraded, [1]=notUpgraded
# $1 upgraded, $6 to remove, $10 not upgraded # => qte_upgradable [0]=upgraded, [1]=notUpgraded
qte_upgradable=($(gawk '/ newly installed/{print $1" "$10}' <<< $stock_upgd)) # tableau
# upgrade
[ "${qte_upgradable[0]}" -gt 1 ] && pluriel="s" || unset pluriel
comment_upgrade="${qte_upgradable[0]} paquet"$pluriel" à mettre à jour"
[ "${qte_upgradable[0]}" -eq 0 ] && comment_upgrade=${comment_upgrade/0 /aucun }
if [ "${qte_upgradable[0]}" -gt 0 ]; then # upgraded
# upgrade
cmd_upgrade="apt list --upgradable"
if [ "${qte_upgradable[0]}" -gt 0 ]; then
upgrade=$( grep '^Inst' <<< "$stock_upgd" )
upgrade=$( sort <<< $upgrade )
upgrade=$( gawk '/Inst /{
@ -1351,6 +1373,7 @@ fi_pkg_apt(){ #v3 17/11/2017
notUpgraded=${notUpgraded// / } # suppression espace double
[ "${qte_upgradable[1]}" -gt 1 ] && pluriel="s" || unset pluriel
comment_notUpgraded="${qte_upgradable[1]} paquet"$pluriel" nécessitant une mise à jour profonde)"
cmd_notUpgraded="apt list --upgradable"
alert_full_upgrade="les paquets peuvent être mis à jour avec avec: \n"
alert_full_upgrade+='`apt full-upgrade` '
fi
@ -1361,29 +1384,61 @@ fi_pkg_apt(){ #v3 17/11/2017
qte_toRemove=$( gawk '/ newly installed/{printf $6}' <<< $toRemove )
toRemove=$( sed '/newly/d' <<< "$toRemove" ) # suppression ligne état
[ "$qte_toRemove" -gt 1 ] && pluriel="s" || unset pluriel
comment_toRemove="$qte_toRemove paquet"$pluriel" non nécessaire"$pluriel
comment_toRemove="$qte_toRemove paquet"$pluriel" inutile"$pluriel
[ "$qte_toRemove" -eq 0 ] && comment_toRemove=${comment_toRemove/0 /aucun }
cmd_toRemove="apt autoremove --simulate"
if [ "$qte_toRemove" -gt 0 ]; then
toRemove=$( sed -E '/^Remv/!d; s/\[.*\]//g; s/Remv //' <<< $toRemove | tr '\n' ' ' )
toRemove=${toRemove// / }
alert_remove="les paquets peuvent être supprimés avec: \n"
alert_remove+='`apt autoremove --purge` \n\n'
alert_remove+="vérifier que la liste ne contient pas des applications devenues importantes \n"
alert_remove+="au besoin, les marquer comme installées manuellement avec apt-mark manual <paquet>\n"
alert_remove+="vérifier que la liste ne contient pas des applications devenues importantes \n"
alert_remove+="au besoin, les marquer comme installées manuellement avec apt-mark manual <paquet> \n"
alert_remove+="ou les installer manuellement avec apt install <paquet>"
fi
# autoclean
printf "◇"
autoclean=$( grep '^Del' <<< $( LC_ALL=C apt-get autoclean --simulate 2>/dev/null ) )
qte_autoclean=$( f__wcv -l "$autoclean" )
[ "$qte_autoclean" -gt 1 ] && pluriel="s" || unset pluriel
comment_autoclean="$qte_autoclean archive"$pluriel" périmée"$pluriel
[ "$qte_autoclean" -eq 0 ] && comment_autoclean=${comment_autoclean/0 /aucune }
cmd_autoclean="apt autoclean --simulate"
if [ "$qte_autoclean" -gt 0 ]; then
autoclean=$( gawk '{print $2}' <<< $autoclean )
alert_autoclean="ces archives de paquets, sans utilité directe dans le système, "
alert_autoclean+="peuvent être supprimées avec: \n"
alert_autoclean+='`apt autoclean` \n'
fi
# clean
clean=$( LC_ALL=C LC_ALL=C du -chS /var/cache/apt/archives/ 2>/dev/null )
size_clean=$( du -ckS /var/cache/apt/archives/ 2>/dev/null | grep -i 'total' ) # affichage en ko
size_clean=${size_clean%[[:blank:]]total}
size_cleanH=$( du -chS /var/cache/apt/ 2>/dev/null | grep -i 'total' ) # affichage en human
size_cleanH=${size_cleanH%[[:blank:]]total}
qte_clean=$( f__wcv -l "$( ls -1 /var/cache/apt/archives/ )")
[ "$qte_clean" -gt 1 ] && pluriel="s" || unset pluriel
comment_clean="taille du cache des paquets"
cmd_clean="du -chS /var/cache/apt/archives/"
if [ "$size_clean" -gt 100 ]; then # alerte si > à 100 ko (cache pas vide)
alert_clean="$qte_clean archive"$pluriel" dans le cache de téléchargement des paquets \n"
alert_clean+="$size_cleanH pourraient être libérés en effaçant ce cache: \n"
alert_clean+='`apt clean` \n'
else # cache vide (72ko)
clean="• cache vide"
fi
# paquet non ^ii
non_ii=$( LC_ALL=C dpkg -l | gawk 'FNR>5 && ! /^i/ {
printf "%-3s %-20s %-12s",$1,$2,$3; $1=$2=$3=$4=""; printf "%s \n",$0}' )
qte_non_ii=$( f__wcv -l "$non_ii" )
[ "$qte_non_ii" -gt 1 ] && pluriel="s" || unset pluriel
comment_non_ii="$qte_non_ii paquet"$pluriel" dans un état non standard"
comment_non_ii="$qte_non_ii paquet"$pluriel" dans un état non standard (^ii)"
[ "$qte_non_ii" -eq 0 ] && comment_non_ii=${comment_non_ii/0 /aucun }
cmd_non_ii="dpkg -l | grep -v '^ii'" # dpkg -l | gawk '! /^ii/ {print $0}'
if [ "$qte_non_ii" -gt 0 ]; then
# extraction différents états constatés
while read etat ligne ; do
stock_etat+="$etat"$'\n'
stock_etat+="$etat"$'\n'
done <<< "$non_ii"
stock_etat=$( sort -u <<< "$stock_etat" ) # tri et dédoublonnage
non_ii+="\n\n ‣ État souhaité / État du paquet / Drapeaux d'erreur\n"
@ -1393,44 +1448,49 @@ fi_pkg_apt(){ #v3 17/11/2017
[[ ${ligne,,} =~ ^p ]] && non_ii+=" p: purge (à purger) "
[[ ${ligne,,} =~ ^r ]] && non_ii+=" r: remove (à supprimer) "
[[ ${ligne,,} =~ ^u ]] && non_ii+=" u: unknown (inconnu) "
[[ ${ligne,,} =~ ^.c ]] && non_ii+=" c: config-files (fichiers de configuration) "
[[ ${ligne,,} =~ ^.f ]] && non_ii+=" f: halF-configured-configured (semi-configuré) "
[[ ${ligne,,} =~ ^.h ]] && non_ii+=" h: Half-installed (semi-installé) "
[[ ${ligne,,} =~ ^.i ]] && non_ii+=" i: installed (installé) "
[[ ${ligne,,} =~ ^.n ]] && non_ii+=" n: not-installed (non installé) "
[[ ${ligne,,} =~ ^.t ]] && non_ii+=" t: triggers-pending (en instance déclencheurs) "
[[ ${ligne,,} =~ ^.u ]] && non_ii+=" u: unpacked (décompressé seulement) "
[[ ${ligne,,} =~ ^.w ]] && non_ii+=" w: triggers-awaiting (attente déclencheurs) "
[[ ${ligne,,} =~ ^..r ]] && non_ii+=" r: (réinstallation requise) " || non_ii+=" / ."
[[ ${ligne,,} =~ ^.c ]] && non_ii+=" c: config-files (fichiers de configuration) "
[[ ${ligne,,} =~ ^.f ]] && non_ii+=" f: halF-configured-configured (semi-configuré) "
[[ ${ligne,,} =~ ^.h ]] && non_ii+=" h: Half-installed (semi-installé) "
[[ ${ligne,,} =~ ^.i ]] && non_ii+=" i: installed (installé) "
[[ ${ligne,,} =~ ^.n ]] && non_ii+=" n: not-installed (non installé) "
[[ ${ligne,,} =~ ^.t ]] && non_ii+=" t: triggers-pending (actions différées en cours) "
[[ ${ligne,,} =~ ^.u ]] && non_ii+=" u: unpacked (décompressé seulement) "
[[ ${ligne,,} =~ ^.w ]] && non_ii+=" w: triggers-awaiting (attente actions différées) "
[[ ${ligne,,} =~ ^..r ]] && non_ii+=" r: (réinstallation requise) " || non_ii+=" / . "
non_ii+=$'\n'
done
non_ii=${non_ii::-1} # suppression $'\n'
alert_non_ii="les paquets dans un état 'rc' (fichiers de configuration restants) "
alert_non_ii+="peuvent être purgés avec: \n"
alert_non_ii+="\`dpkg --purge \$(dpkg -l | awk '/^rc/{print \$2}'\`) \n\n"
alert_non_ii+="les paquets dans un autre état doivent être examinés avec précaution \n"
alert_non_ii+="un paquet _hi_ indique juste un paquet épinglé (hold)"
if grep -q '^rc' <<< "$stock_etat"; then
alert_non_ii="les paquets dans un état 'rc' (fichiers de configuration orphelins) "
alert_non_ii+="peuvent être purgés avec: \n"
alert_non_ii+="\`dpkg --purge \$(dpkg -l | awk '/^rc/{print \$2}'\`)"
fi
fi
# deborphan éventuel
if [ "$( f__cmd_exist deborphan )" ]; then
deborphan=$( deborphan -P )
cmd_deborphan="deborphan -P"
qte_deborphan=$( f__wcv "-l" "$deborphan" )
[ "$qte_deborphan" -gt 1 ] && pluriel="s" || unset pluriel
comment_deborphan="$qte_deborphan bibliothèque"$pluriel" orpheline"$pluriel
[ "$qte_deborphan" -eq 0 ] && comment_deborphan=${comment_deborphan/0 /aucune }
if [ "$qte_deborphan" -gt 0 ]; then
alert_deborphan="bibliothèque"$pluriel" orpheline"$pluriel", suppression possible: \n"
alert_deborphan+='`apt remove \$(deborphan)` \n'
alert_deborphan+="recherche légère, mais vérifier avant de valider la suppression \n"
alert_deborphan+='`apt purge \$(deborphan)` \n'
alert_deborphan+="recherche légère, mais vérifier avant de valider la suppression \n"
alert_deborphan+="Relancer la commande jusqu'à vidage complet, les bibliothèques pouvant "
alert_deborphan+="s'installer en cascade/"
alert_deborphan+="s'installer en cascade"
fi
fi
# paquets figés
holded=$( apt-mark showhold )
qte_holded=$( f__wcv "-l" "$holded" )
[ "$holded" ] && holded=$( sort <<< $holded | tr '\n' ' ' )
[ "$qte_holded" -gt 1 ] && pluriel="s" || unset pluriel
comment_holded="$qte_holded paquet"$pluriel" épinglé"$pluriel
comment_holded="$qte_holded paquet"$pluriel" figé"$pluriel
[ "$qte_holded" -eq 0 ] && comment_holded=${comment_holded/0 /aucun }
cmd_holded="apt-mark showhold"
# avertissement
info_update="apt update n'a pas été lancé. Se référer à la date de mise à jour "
info_update+="et au besoin relancer le script après avoir lancé la mise à jour. \n"
info_update+="la précision de cette partie du rapport pourra en être améliorée. "
@ -1440,23 +1500,26 @@ fi_pkg_apt(){ #v3 17/11/2017
text+="* dernière mise à jour apt: **$dateMaj** \n"
text+="\n"
f_dspl_alert "info_update" "info"
f_display "sources" "cmd" "grep -Ersv '^#|^$' /etc/apt/sources.list /etc/apt/sources.list.d/*.list" \
"dépôts"
f_display "sources" "cmd" "$cmd_sources" "$comment_sources"
f_dspl_alert "alert_non_list" "info"
f_dspl_alert "alert_httpredir" "info"
f_display "upgrade" "cmd:vide" "apt list --upgradable" "$comment_upgrade"
f_display "apt_prefs" "cmd" "$cmd_apt_prefs" "$comment_apt_prefs"
f_display "upgrade" "cmd:vide" "$cmd_upgrade" "$comment_upgrade"
f_dspl_alert "alert_upgrade" "info"
f_display "notUpgraded" "cmd" "apt list --upgradable" "$comment_notUpgraded"
f_display "notUpgraded" "cmd" "$cmd_notUpgraded" "$comment_notUpgraded"
f_dspl_alert "alert_full_upgrade" "info"
f_display "toRemove" "cmd:vide" "apt autoremove --simulate" "$comment_toRemove"
f_display "toRemove" "cmd:vide" "$cmd_toRemove" "$comment_toRemove"
f_dspl_alert "alert_remove" "info"
#dpkg -l | gawk '! /^ii/ {print $0}'
f_display "non_ii" "cmd:vide" "dpkg -l | grep -v '^ii'" "$comment_non_ii"
f_display "autoclean" "cmd:vide" "$cmd_autoclean" "$comment_autoclean"
f_dspl_alert "alert_autoclean" "info"
f_display "clean" "cmd:vide" "$cmd_clean" "$comment_clean"
f_dspl_alert "alert_clean" "info"
f_display "non_ii" "cmd:vide" "$cmd_non_ii" "$comment_non_ii"
f_dspl_alert "alert_non_ii" "info"
[ "$( f__cmd_exist deborphan )" ] && f_display "deborphan" "cmd:vide" "deborphan -P" \
[ "$( f__cmd_exist deborphan )" ] && f_display "deborphan" "cmd:vide" "$cmd_deborphan" \
"$comment_deborphan"
[ "$( f__cmd_exist deborphan )" ] && f_dspl_alert "alert_deborphan" "info"
f_display "holded" "cmd:vide" "apt-mark showhold" "$comment_holded"
f_display "holded" "cmd:vide" "$cmd_holded" "$comment_holded"
printf "$text\n" >> "$fileOutput"
unset text
}
@ -1545,7 +1608,7 @@ fi_pkg_x(){ #v2 17/11/2017
f_display "alert_pkg_todo" "var" "" "aide souhaitée"
}
fi_reseau(){ # 13/11/2017
fi_reseau(){ # 18/11/2017
local slots cards ip_a iwconfig interfaces route resolv canal_wifi ifx text pluriel
local alert_wlx alert_ifconfig
# cardsManuel="$(lspci -nnk | grep -EiA 5 'network|ethernet')"
@ -1588,7 +1651,7 @@ fi_reseau(){ # 13/11/2017
if grep -iq 'wlx' <<< "$fg_ifn"; then
alert_wlx="Une interface wifi est en erreur: $(grep -o 'wlx' <<< $fg_ifn) \n"
alert_wlx+="l'interface n'est pas reconnue et est donc mal nommée, "
alert_wlx+="éventuellement, changer le renommage: \n"
alert_wlx+="éventuellement, changer le renommage: \n"
alert_wlx+="https://kyodev.frama.io/kyopages/trucs/interfaces-nommage-classique/"
fi
if [ $(f__cmd_exist ifconfig) ] ; then
@ -1719,7 +1782,7 @@ fi_system_analyse(){ # 16/11/2017
for isrvc in $srvcFail_list; do
alert_srvcFail+="\`systemctl status $isrvc\` \n"
alert_srvcFail+='```\n'
alert_srvcFail+="$( systemctl status $isrvc 2>&1 ) \n"
alert_srvcFail+="$( systemctl status $isrvc 2>&1 ) \n"
alert_srvcFail+='```\n'
done
alert_srvcFail=${alert_srvcFail//●}
@ -1739,7 +1802,7 @@ fi_system_analyse(){ # 16/11/2017
unset text
}
fi_systeme(){ # 17/11/2017
fi_systeme(){ # 18/11/2017
local mbr uname bootImage initDaemon xorg shells lastboot uptime charge pluriel text
local alimentation alim_total ish ifs_origin ligne date_install microcode
local alert_SLiM alert_microcode
@ -1806,7 +1869,7 @@ fi_systeme(){ # 17/11/2017
if [[ "$debOnlyPackages" =~ $fg_vendor ]]; then
[ "$fg_vendor" == "amd" ] && microcode="amd64-microcode" || microcode="intel-microcode"
alert_microcode="microcodes $fg_vendor non installés (corrections bugs du processeur) (non libres), "
alert_microcode+="les installer: \n \`apt install $microcode\`"
alert_microcode+="les installer: \n\`apt install $microcode\`"
fi
###
f__architecture || f__info "Architecture non supportée" "vous pouvez contacter $projet, $contact " \

View File

@ -4,16 +4,27 @@
* ! f__requis, fscript_install, f__scandir
## 2.38.0 18/11/2017
* nouveau: fi_pkg_apt, test clean, autoclean, préférences apt
* nouveau: fi_journal, alerte firmware bug (microcode)
* révision: retour lignes alertes, format markdown
* fix: fi_pkg_apt, détection full-upgrade
* fix: fi_disk, détection fichier resume absent
## 2.37.3 17/11/2017
* révision complète: fi_packager fi_pkg_x
* fusion pkg_ctl & fi_packager
* fix: affichage microcodes installés
## 2.36.4 17/11/2017
* fix mineurs: fi_pkg_apt
## 2.36.0 16/11/2017
* nouveau: fi_pkg_apt, test paquets hold, révision affichage & non standard
@ -45,7 +56,7 @@
## 2.32.0 12/11/2017
# nouveau: structure pour accueillir autres gestionnaires de paquets que dpkg,
* nouveau: structure pour accueillir autres gestionnaires de paquets que dpkg,
nbre de paquets installés si infos trouvées
## 2.31.2 12/11/2017