getInfo 2.17.1

This commit is contained in:
kyodev 2017-10-25 23:45:00 +02:00
parent d64ea1f8b5
commit 86dacb3674
2 changed files with 43 additions and 34 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
version=2.17.0
version=2.17.1
date="25/10/2017"
projet="simpledeb"
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
@ -8,7 +8,7 @@ script="getInfo"
##### license LPRAB/WTFPL
# auteur: simpledeb
# contributeurs: kyodev, saiqui, naguam
# contributeurs: kyodev, saiqui, naguam, agentcobra
#####
# assigne $affichage_text
@ -308,7 +308,7 @@ f__wget_test(){ # 17/10/2017
# f_display: $1 variable à afficher, $2=var|cmd|sans (type titrage) [$3 titrage] [$4 commentaire titrage dans cmd]
# f_display "variable" "type" "titrage" "titrage_commentaire"
f_display(){ # 25/10/2017
[ "$text" ] && printf "$text" >> "$fileOutput" # flush avant fonction de text parent
[ "$text" ] && echo -en "$text" >> "$fileOutput" # flush avant fonction de text parent
unset text
local display=""
[[ "$2" == "sans" || "$2" == "var" || "$2" == "cmd" ]] || display="erreur script \$2 ($1 $2 $3)"
@ -529,27 +529,38 @@ fi_dmesg(){ # 25/10/2017
}
fi_graph(){ # 25/10/2017
local slotGraphCards graphCards openGl resolutions logXorg modules ig text
local slotGraphCards graphCards alert_Multicarte openGl resolutions logXorg modules ig text
# graphCardsManuel="$(lspci -nnk | grep -EiA 3 'vga|display|3d')"
# graphCardsManuel="$(lspci -nnv | grep -iEA 13 'vga|display|3d)"
# graphCardsManuel="lspci -nnv -s $( lspci | grep -Ei 'vga|display|3d' | cut -d" " -f1 )"
slotGraphCards="$(lspci | grep -Ei 'vga|display|3d' | cut -d" " -f1)"
# debug: slotGraphCards="$(cat tests/lspci | grep -Ei 'vga|display|3d' | cut -d" " -f1)"
for ig in $slotGraphCards; do
graphCards+="$(lspci -nnv -s $ig)"$'\n'
done
graphCards=${graphCards::-1} # suppression dernier $'\n'
if [ "$(f__cmd_exist optirun)" ]; then
infoBumblebee="Attention **Bumblebee** est installé. Cela peut désactiver l'affichage de \`lspci\` "
infoBumblebee+="comme par exemple: \'!!! Unknown header type 7f\'. Vous pouvez lancer alors le script "
infoBumblebee+="avec optirun ./getInfo"
if [ $(f__cmd_exist optirun) ]; then
for ig in $slotGraphCards; do
graphCards+=$(optirun lspci -nnv -s $ig)$'\n'
done
else
for ig in $slotGraphCards; do
graphCards+=$(lspci -nnv -s $ig)$'\n'
done
fi
[ "$(f__cmd_exist glxinfo)" ] && openGl="$(glxinfo | grep 'OpenGL version')"
[ "$(f__cmd_exist xrandr)" ] && resolutions="$(xrandr --query | grep '^ *[0-9]' | head -n 10)"
modules="$(lsmod | grep -Ei 'amdgpu|ati|i915|nouveau|nvidia|radeon|video|gma')"
if [ $(grep -c 'Unknown header type 7f' <<< "$graphCards") -gt 0 ]; then
for ig in $slotGraphCards; do
graphCards+=$(DRI_PRIME=1 lspci -nnv -s $ig)$'\n'
done
fi
if [ $(grep -c 'Unknown header type 7f' <<< "$graphCards") -gt 0 ]; then
alert_Multicarte="Une carte graphique est désactivée actuellement par Bumbledee ou "
alert_Multicarte+="vga-switcheroo/DRI_PRIME, lspci n'est pas complet, "
alert_Multicarte+="malgré un lancement avec \`optirun\` ou \`DRI_PRIME=1 lspci\`"
fi
[ $(f__cmd_exist glxinfo) ] && openGl="$(glxinfo | grep 'OpenGL version')"
[ $(f__cmd_exist xrandr) ] && resolutions="$(xrandr --query | grep '^ *[0-9]' | head -n 10)"
modules=$(lsmod | grep -Ei 'amdgpu|ati|i915|nouveau|nvidia|radeon|video|gma')
[ "$fget_resolution" ] || figet_gpu
[ "$fget_resolution" ] || figet_resolution
###
###
text="## graphisme \n\n"
# cartes graphiques
text+="$(sed -E 's/(.*)/> \* \*\*\1\*\*/' <<< $fget_gpu) \n"
@ -558,6 +569,7 @@ fi_graph(){ # 25/10/2017
# lspci
f_display "graphCards" "cmd" "lspci -nnv | grep -iEA 13 'vga|display|3d"
# f_display "graphCards" "cmd" "lspci -nnv -s \$( lspci | grep -Ei 'vga|display|3d' | cut -d\" \" -f1 )"
[ "$alert_Multicarte" ] && text+="$alert_Multicarte \n\n"
# openGl
[ "$openGl" ] && f_display "openGl" "cmd" "glxinfo | grep 'OpenGL version"
# résolutions possibles, pas d'affichage si vode (ssh) ou xrandr pas accessible
@ -567,8 +579,7 @@ fi_graph(){ # 25/10/2017
# modules vidéo
text+="### modules video \n\n"
if [ "$modules" ]; then
f_display "modules" "var" "liste non garantie complète"
[ "$infoBumblebee" ] && text+="$infoBumblebee"
f_display "modules" "var" "modules recherchés: amdgpu, ati, i915, nouveau, nvidia, radeon, video, gma"
else
text+="Modules non reconnus. Il serait bien de communiquer le retour de \`lsmod\` pour mettre "
text+="à jour le script. Merci de contacter $projet: \n$contact "
@ -657,9 +668,7 @@ fi_locale(){ # 25/10/2017
local xKeyboardMap keyboard alert_Rtc alert_Rtc_info alert_NTP alert_Ntp_info text
# locale
locale="$(grep -Esv '#|^$' /etc/default/locale* /etc/locale.conf)"
if [ "$(f__cmd_exist localectl)" ]; then
localectl=$(localectl --no-pager status)
fi
[ "$(f__cmd_exist localectl)" ] && localectl=$(localectl --no-pager status)
# timezone
timezone="$(grep -s . /etc/timezone)"
if [ "$(f__cmd_exist timedatectl)" ]; then
@ -679,20 +688,19 @@ et/ou installer le démon Ntp: apt install ntp \n"
###
text="## localisation \n\n"
# locale
f_display "locale" "cmd" "grep -Esv '#|^$' /etc/default/locale* /etc/locale.conf"
f_display "localectl" "cmd" "localectl --no-pager status"
[ "$locale" ] && f_display "locale" "cmd" "grep -Esv '#|^$' /etc/default/locale* /etc/locale.conf"
[ "$localectl" ] && f_display "localectl" "cmd" "localectl --no-pager status"
# timezone
f_display "timezone" "cmd" "grep -s . /etc/timezone*"
[ "$timedatectl" ] && f_display "timedatectl" "cmd" "timedatectl status --no-pager"
[ "$alert_Rtc" ] && text+="$alert_Rtc_info \n"
[ "$alert_Ntp" ] && text+="$alert_Ntp_info \n"
# keyboard layout
f_display "keyboard" "cmd" "grep -Ev '#|^$' /etc/default/keyboard"
if [ "$xKeyboardMap" ]; then
f_display "xKeyboardMap" "cmd" "setxkbmap -query"
else
text+="**pas d'informations détectées** \n\n"
fi
[ "$keyboard" ] && f_display "keyboard" "cmd" "grep -Ev '#|^$' /etc/default/keyboard"
[ "$xKeyboardMap" ] && f_display "xKeyboardMap" "cmd" "setxkbmap -query"
# else
# text+="**pas d'informations détectées** \n\n"
# fi
printf "$text\n" >> "$fileOutput"
unset text
}
@ -1958,7 +1966,7 @@ prg_1(){ # début
echo > "$fileOutput"
chown $user_: "$fileOutput" &>/dev/null
chmod 666 "$fileOutput" &>/dev/null # rw-rw-rw-, si root permet écriture & effacement à tous
echo -e "> **$script** sur $(uname -n) \n" > "$fileOutput"
echo -e "> $script sur **$(uname -n)** \n" > "$fileOutput"
echo -e "$ligneRapport \n\n" >> "$fileOutput"
}
prg_2(){ # traitements principaux
@ -2115,7 +2123,7 @@ for j in $options; do
case $j in
-t | --test )
prg_1 "$*"
fi_locale
fi_graph
prg_3
exit ;; # test seulement
-c* | all )

View File

@ -8,19 +8,20 @@
* "alertifier" fi-reseau
* refaire/revoir figet_resolution
* revoir modules réseau
* bug figet_wm wayland à confirmer?
* bat une ligne de trop, idem lspci tester dernier caractère
* réviser alert_
---
* f__requis f__wget_test fscript_get_version fscript_update fscript_cronAnacron
* f__cmd_exist f__sudo f__requis
## 2.17.0 25/10/2017
## 2.17.1 25/10/2017
* révision: batterie, unité en W au lieu de mW, mA inchangé
* fix: fi_locale compatible fedora
* fix: fi_locale compatible fedora (arch ok)
* fix, révision: modification complète des séquences peuplement rapport et modules fi_* autonomes
* fix: bug affichage disque sata
* fix: f_display, affichage sur --debug-*
## 2.15.0 24/10/2017