getInfo 2.18.5

This commit is contained in:
kyodev 2017-10-26 19:31:32 +02:00
parent b2d8039768
commit ec5b81410d
2 changed files with 22 additions and 29 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
version=2.18.4
version=2.18.5
date="26/10/2017"
projet="simpledeb"
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
@ -534,7 +534,7 @@ fi_dmesg(){ # 25/10/2017
unset text
}
fi_graph(){ # 26/10/2017-3
fi_graph(){ # 26/10/2017-4
local slotGraphCards graphCards cmd alert_Multicarte alert_3D openGl resolutions logXorg modules ig text
# graphCardsManuel="$(lspci -nnk | grep -EiA 3 'vga|display|3d')" # -nn: textual and numeric ID's, k kernel
# graphCardsManuel="$(lspci -nnv | grep -iEA 13 'vga|display|3d)" # v=verbose
@ -543,26 +543,21 @@ fi_graph(){ # 26/10/2017-3
#debug: slotGraphCards="$(cat tests/lspci | grep -Ei 'vga|display|3d' | cut -d" " -f1)"
# lspci
slotGraphCards="$(lspci | grep -Ei 'vga|display|3d' | cut -d" " -f1)"
graphCards=${graphCards::-1} # suppression dernier $'\n'
for ig in $slotGraphCards; do
graphCards+=$(DRI_PRIME=1 lspci -nnv -s $ig)$'\n'
done
cmd="DRI_PRIME=1 lspci -nnv | grep -iEA 13 'vga|display|3d'"
if [ $(grep -c 'Unknown header type 7f' <<< "$graphCards") -gt 0 ] && [ $(f__cmd_exist optirun) ]; then
if [ $(f__cmd_exist optirun) ]; then
for ig in $slotGraphCards; do
graphCards+=$(optirun lspci -nnv -s $ig)$'\n'
done
cmd="optirun lspci -nnv | grep -iEA 13 'vga|display|3d'"
else
for ig in $slotGraphCards; do
graphCards+=$(DRI_PRIME=1 lspci -nnv -s $ig)$'\n'
done
cmd="DRI_PRIME=1 lspci -nnv | grep -iEA 13 'vga|display|3d'"
fi
graphCards=${graphCards::-1} # suppression dernier $'\n'
if [ $(grep -c 'Unknown header type 7f' <<< "$graphCards") -gt 0 ]; then
alert_Multicarte="Une carte graphique est désactivée actuellement, lspci n'est pas complet. \n"
alert_Multicarte+="Voir DRI_PRIME, vga-switcheroo, Bumbledee...? \n"
if [ $(f__cmd_exist xrandr) ]; then
[ $(lspci -nn | grep -c '\''[030[02]\]') != $(xrandr --listproviders | grep -c 'Provider ') ] && \
alert_Multicarte+="Le nombre de cartes n'est pas égal au nombre de fournisseurs. \n"
alert_Multicarte+="\`\`\`\nxrandr --listproviders\n$(xrandr --listproviders) \n\`\`\`\n"
fi
alert_Multicarte=${alert_Multicarte:-1}
fi
# openGl
if [ $(f__cmd_exist glxinfo) ]; then
@ -822,7 +817,7 @@ fi_nonFree(){ # 25/09/2017
}
fi_reseau(){ # 26/10/2017
local slotNetCard netCard ip_a iwconfig interfaces route resolv liste_canaux_wifi ifx text pluriel
local slotNetCard netCard ip_a iwconfig interfaces route resolv canal_wifi ifx text pluriel
# netCardManuel="$(lspci -nnk | grep -EiA 5 'network|ethernet')"
# netCardManuel="$(lspci -nnv | grep -EiA 15 'network|ethernet')"
# netCardManuel="lspci -nnv -s $( lspci | grep -Ei 'network|ethernet' | cut -d" " -f1 )"
@ -845,9 +840,9 @@ fi_reseau(){ # 26/10/2017
if [ "$(f__cmd_exist iwconfig)" ]; then #paquet wireless-tools requis
iwconfig="$(iwconfig 2>&1 | grep -v 'no wireless extensions' | grep -v '^$')"
fi
# iwlist
if [ "$(f__cmd_exist iwlist)" ]; then # liste canaux wifi; paquet wireless-tools requis
liste_canaux_wifi="$(iwlist chan 2>&1 | grep -Ev 'no frequency information|^$')"
# iwlist
if [ "$(f__cmd_exist iwlist)" ]; then # liste canaux wifi; /sbin, paquet wireless-tools requis
canal_wifi="$(iwlist chan 2>&1 | grep 'Current Frequency' | grep -Eio 'channel [0-9]+')"
fi
# network manager
netmgrpaths=("/usr/sbin/NetworkManager" "/usr/sbin/wicd" "/usr/sbin/connmand")
@ -860,7 +855,7 @@ fi_reseau(){ # 26/10/2017
done
figet_ip
figet_mod_net
###
###
text="## réseau \n\n"
#lspci
f_display "netCard" "cmd" "lspci -nnv | grep -EiA 15 'network|ethernet"
@ -885,10 +880,10 @@ fi_reseau(){ # 26/10/2017
f_display "resolv" "cmd" "cat /etc/resolv.conf" "(serveurs de noms DNS utilisés)"
# iwconfig & iwlist
[ "$iwconfig" ] && f_display "iwconfig" "cmd" "iwconfig"
if [ "$liste_canaux_wifi" ]; then
f_display "liste_canaux_wifi" "cmd" "iwlist chan"
text+="* la configuration ssid utilisé peut être connue (si NetworkManager utilisé) avec "
text+="\`./getInfo --ssid\` ou \n \`getInfo --ssid\` (script installé) \n\n"
if [ "$canal_wifi" ]; then
f_display "canal_wifi" "cmd" "iwlist chan | grep 'Current Frequency' | grep -Eio 'channel [0-9]+'"
text+="* la configuration ssid utilisé peut être connue (si NetworkManager utilisé) avec \n"
text+="\`./getInfo --ssid\` ou \`getInfo --ssid\` (script installé) \n\n"
fi
# networl manager
if [ "$netmgrinst" ]; then
@ -1172,7 +1167,7 @@ figet_batt(){ #v2 26/10/2017
batt_capa_full="$(printf "%'d" $batt_capa_full)"
batt_conso="$(printf "%'d" $batt_conso)"
fi
# sortie
# sortie
batt_detail+="$ibat: $(cat $batRep/$ibat/manufacturer 2>/dev/null) "
batt_detail+="($(cat $batRep/$ibat/model_name 2>/dev/null)) $(cat $batRep/$ibat/technology 2>/dev/null) "
batt_detail+="$batt_capa_design$batt_unit - $batt_volt_min""V / $batt_volt_now""V (mini/actuel) "

View File

@ -6,24 +6,22 @@
* placer ln dans /usr/local/bin au lieu de /usr/bin ?
* réseau réviser, interface name: virbr0, docker0
* "alertifier" fi-reseau
* refaire/revoir figet_resolution
* revoir modules réseau
* réviser alert_
* iwlist chan, alléger, sortie juste canal utilisé
---
* f__requis f__wget_test fscript_get_version fscript_update fscript_cronAnacron
* f__cmd_exist f__sudo f__requis
## 2.18.4 26/10/2017
## 2.18.5 26/10/2017
* nouveau: figet_screen (nb écrans & résolutions)
* suppression: figet_resolution neofetch
* nouveau: xrandr multi-écrans
* révision: affichage des fichiers manquants
* révision: fi_graph, version 3
* révision: fi_graph, version 4 (pour fixer sortie sur multi-cartes hybrides)
* révision: fi_reseau, iwlist chan, juste sortie canal utilisé
* fix: suppression s/n batterie si champs rempli d'espace vide
## 2.17.4 25/10/2017