getInfo 2.26.1

This commit is contained in:
kyodev 2017-11-07 16:32:36 +01:00
parent 470c6700ad
commit 5d1b5bc84c
2 changed files with 17 additions and 17 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
version=2.26.0
version=2.26.1
date="07/11/2017"
projet="simpledeb"
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
@ -324,11 +324,11 @@ f_display(){ # 07/11/2017
[ "$text" ] && echo -en "$text" >> "$fileOutput" # flush, avant fonction, de text parent
unset text
local display=""
[[ "$2" =~ sans|var|cmd ]] || display="$BOLDerreur script \$2 ($1 $2 $3)$STD \n"
[ "$2" == "var" ] && display="**$BOLD$3$STD** \n"
[ "$2" == "cmd" ] && display="\`$ITAL$3$STD\` \n"
[[ "$2" =~ sans|var|cmd ]] || display="erreur script \$2 ($1 $2 $3) \n"
[ "$2" == "var" ] && display="**$3** \n"
[ "$2" == "cmd" ] && display="\`$3\` \n"
#echo $(sed -En 's/[^/]*(\/.*)$/\1/p' <<< "$3")
[[ "$2" == "cmd" && "$4" ]] && display="\`$3\`"$'\xc2\xa0'$'\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0'" **$BOLD$4$STD** \n"
[[ "$2" == "cmd" && "$4" ]] && display="\`$3\`"$'\xc2\xa0'$'\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0'" **$4** \n"
display+='``` \n'
display+="${!1} \n"
display+='``` \n'
@ -345,7 +345,7 @@ f_display_grep(){ # 07/11/2017
local file var_temp
for file in $1; do
var_temp="$(grep -Ersv '^#|^[[:space:]]*$' $file)"
[ "$var_temp" ] && echo "$BOLD $file$STD"
[ "$var_temp" ] && echo " $file"
if [ "$2" ]; then
gawk -v "larg=$2" '{printf "%-"larg"s",$1; s1=""; printf "%s\n",$0}' <<< "$var_temp"
else
@ -429,7 +429,7 @@ fi_cpu(){ # 07/11/2017
[ "$fg_cpu" ] || figet_cpu
###
[ ${fg_cpu:0:1} -gt 1 ] && pluriel="s" || unset pluriel
text="##$BOLD processeur$pluriel $STD\n\n"
text="## processeur$pluriel \n\n"
f_display "fg_cpu" "cmd" "lscpu" # affichage proc
[ "$fg_uarch" ] && f_display "fg_uarch" "var" "µarchitecture processeur"
[ "$cpu_flags" ] && f_display "cpu_flags" "var" "flags cpu" # flags cpu bruts
@ -1027,7 +1027,7 @@ et/ou installer le démon Ntp: apt install ntp \n"
keyboard="$(f_display_grep "/etc/default/keyboard*")"
[ "$(f__cmd_exist setxkbmap)" ] && xKeyboardMap="$(setxkbmap -query)"
###
text="##$BOLD localisation $STD\n\n"
text="## localisation \n\n"
# locale
[ "$locale" ] && f_display "locale" "cmd" "grep -Esv '#|^[[:space:]]*$' /etc/default/locale* /etc/locale.conf"
[ "$localectl" ] && f_display "localectl" "cmd" "localectl --no-pager status"
@ -1058,7 +1058,7 @@ fi_log_xorg(){ # 07/11/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+=" $BOLD$xfile, date de modification: $dateFile $STD\n\n"
logXorg+=" $xfile, date de modification: $dateFile \n\n"
logXorg+=" (WW) **warning**, (EE) **erreur**, (??) inconnu, $nb_lignes premières lignes \n"
logXorg+="$(grep -E '\(EE\)' <<< $extract) \n"
logXorg+="$(grep -E '\(WW\)' <<< $extract) "$'\n'$'\n'
@ -1071,7 +1071,7 @@ fi_log_xorg(){ # 07/11/2017
done
logXorg="${logXorg::-2}"
###
text="##$BOLD journaux Xorg $STD\n\n"
text="## journaux Xorg \n\n"
f_display "logXorg" "cmd" \
"grep -Es '\(WW\)|\(EE\)|\(\?\?\)' /var/log/Xorg.?.log /home/<user>/.local/share/xorg/Xorg.?.log" \
"(Xorg.log)"
@ -1162,7 +1162,7 @@ fi_reseau(){ # 07/11/2017
fi
figet_mod_net
###
text="##$BOLD réseau $STD\n\n"
text="## réseau \n\n"
#lspci
[ "$cards" ] && f_display "cards" "cmd" "lspci -nnv | grep -EiA 15 'network|ethernet"
# ip locales avec type
@ -1303,7 +1303,7 @@ fi_sources(){ #v2 07/11/2017
alert_non_ii=${alert_non_ii::-1} # suppression dernier $'\n'
fi
###
text="##$BOLD gestion de paquets DPKG$STD \n\n"
text="## gestion de paquets DPKG \n\n"
f_display "sources" "cmd" "grep -Ersv '^#|^[[:space:]]*$' /etc/apt/sources.list /etc/apt/sources.list.d/*.list"
text+="* nombre de paquets installés: **$nb_packages** \n"
text+="* dernière mise à jour apt: **$dateMaj** \n\n"
@ -2560,28 +2560,28 @@ prg_2(){ # traitements principaux
fi
printf " •"
if [[ "$1" == all || "$1" =~ s ]]; then #systeme, matériel -cs
echo -e "#$BOLD ▷ Système $STD\n\n" >> "$fileOutput"
echo -e "# ▷ Système \n\n" >> "$fileOutput"
for i in fi_systeme fi_cpu fi_mem fi_hw fi_batt fi_graph fi_disk fi_usb ; do
$i
printf "•"
done
fi
if [[ "$1" == all || "$1" =~ c ]]; then #configuration #debian, packages -cc
echo -e "#$BOLD ▷ Configuration $STD\n\n" >> "$fileOutput"
echo -e "# ▷ Configuration \n\n" >> "$fileOutput"
for i in fi_locale fi_vrms fi_sources ; do
$i
printf "•"
done
fi
if [[ "$1" == all || "$1" =~ r ]]; then #reseau -cr
echo -e "#$BOLD ▷ Réseau $STD\n\n" >> "$fileOutput"
echo -e "# ▷ Réseau \n\n" >> "$fileOutput"
for i in fi_reseau fi_nm ; do
$i
printf "•"
done
fi
if [[ "$1" == all || "$1" =~ a ]]; then #analyse -ca
echo -e "#$BOLD ▷ Analyse $STD\n\n" >> "$fileOutput"
echo -e "# ▷ Analyse \n\n" >> "$fileOutput"
for i in fi_system_analyse fi_log_xorg fi_journal ; do
$i
done

View File

@ -3,7 +3,7 @@
* f__wcv, f_display_grep, f__wget_test, fscript_get_version, fscript_update
## 2.26.0 07/11/2017
## 2.26.1 07/11/2017
* révision: fi_sources v2
* révision: affichage grep files: fi_reseau, fi_locale, fi_log_xorg