mirror of https://framagit.org/kyodev/kyopages.git
getInfo 2.11.2
This commit is contained in:
parent
d2484c0df1
commit
3a906c05cb
314
scripts/getInfo
314
scripts/getInfo
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
version=2.11.1
|
||||
date="20/10/2017"
|
||||
version=2.11.2
|
||||
date="21/10/2017"
|
||||
projet="simpledeb"
|
||||
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
|
||||
script="getInfo"
|
||||
|
@ -293,6 +293,39 @@ f__wget_test(){ # 17/10/2017
|
|||
exit 0
|
||||
}
|
||||
|
||||
# $1 variable à afficher, $2=var|cmd|sans (type titrage) [$3 titrage] [$4 commentaire titrage dans cmd]
|
||||
f_display(){ # 21/10/2017
|
||||
[ "$text" ] && echo -e "$text" >> "$fileOutput" # flush avant fonction
|
||||
unset text
|
||||
local text
|
||||
[[ "$2" == "sans" || "$2" == "var" || "$2" == "cmd" ]] || f__error "erreur \$2 ($1 $2)"
|
||||
[ "$2" == "var" ] && text="**$3** \n"
|
||||
[ "$2" == "cmd" ] && text="\`$3\` \n"
|
||||
[[ "$2" == "cmd" && "$4" ]] && text="\`$3\` $4 \n"
|
||||
text+='``` \n'
|
||||
text+="${!1} \n"
|
||||
text+='``` \n\n'
|
||||
echo -e "$text" >> "$fileOutput" # flush fonction
|
||||
}
|
||||
|
||||
# $1 répertoire à scanner, $2 profondeur
|
||||
f_display_scandir(){ # 21/10/2017
|
||||
[ "$text" ] && echo -e "$text" >> "$fileOutput" # flush avant fonction
|
||||
unset text
|
||||
local text
|
||||
text="\`$1 $2\` \n"
|
||||
text+='``` \n'
|
||||
echo -e "$text" >> "$fileOutput" # flush avant scandir
|
||||
unset text
|
||||
if [ -d "$1" ]; then
|
||||
f__scandir $1 $2
|
||||
else
|
||||
text="$1 inexistant \n"
|
||||
fi
|
||||
text+='``` \n'
|
||||
echo -e "$text" >> "$fileOutput" # flush fonction
|
||||
}
|
||||
|
||||
f_help(){ # 19/10/2017
|
||||
printf "$BLUE"
|
||||
cat << 'EOF'
|
||||
|
@ -357,7 +390,7 @@ fi_cpu(){ # 17/10/2017
|
|||
echo -e "$text" >> "$fileOutput"
|
||||
}
|
||||
|
||||
fi_disk(){ # 19/10/2017
|
||||
fi_disk(){ #v2 21/10/2017
|
||||
local disk_lsblk disk_df disk_df_i fstab resume idResume idSwap alert_uuidResume text pluriel
|
||||
local dd_temp dd_temp_alert dd_temp idisk tempodd
|
||||
disk_lsblk="$(lsblk -o NAME,FSTYPE,SIZE,LABEL,MOUNTPOINT,UUID)"
|
||||
|
@ -366,10 +399,11 @@ fi_disk(){ # 19/10/2017
|
|||
fstab="$(grep -Ev '^[[:blank:]]*#|^$' /etc/fstab)"
|
||||
resume="$(grep -Evs '^[[:blank:]]*#|^$' /etc/initramfs-tools/conf.d/resume)"
|
||||
if [ -z "$resume" ]; then
|
||||
alert_resume="pas de fichier _resume_ dans /etc/initramfs-tools/conf.d/ \n"
|
||||
alert_resume+="ce n'est pas forcément une erreur et n'a pas d'incidence si l'hibernation n'est pas utilisée \n"
|
||||
alert_resume+="cela pourrait générer des erreurs en cas d'hibernation et de multiples partitions swap. "
|
||||
alert_resume+="il vaudrait peut-être mieux créer alors ce fichier. \n"
|
||||
# alert resume absent
|
||||
resume="pas de fichier _resume_ dans /etc/initramfs-tools/conf.d/ \n"
|
||||
resume+="ce n'est pas forcément une erreur et n'a pas d'incidence si l'hibernation n'est pas utilisée \n"
|
||||
resume+="cela pourrait générer des erreurs en cas d'hibernation et de multiples partitions swap. \n"
|
||||
resume+="il vaudrait peut-être mieux créer alors ce fichier. \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')"
|
||||
|
@ -391,6 +425,7 @@ fi_disk(){ # 19/10/2017
|
|||
dd_temp_alert=${dd_temp_alert::-1} # suppression dernier $'\n'
|
||||
fi
|
||||
###
|
||||
# f_display "variable(sans $)" "type=var|cmd|sans" "titrage" "comment_titrage"
|
||||
text="## disque(s) \n\n"
|
||||
text+='``` \n'
|
||||
# espace des partitions fixes montées
|
||||
|
@ -420,50 +455,30 @@ fi_disk(){ # 19/10/2017
|
|||
text+="| :---: | :---: | :---: | :---: | \n"
|
||||
text+="| $fget_disk_ata | $fget_disk_usb | $fget_disk_mmc | $fget_disk_nvme | \n\n"
|
||||
# éventuellement hddtemp
|
||||
if [ "$dd_temp" ]; then
|
||||
text+='`hddtemp /dev/sd?` (température disques) \n'
|
||||
text+='``` \n'
|
||||
text+="$dd_temp \n"
|
||||
text+='``` \n'
|
||||
fi
|
||||
[ "$dd_temp" ] && f_display "dd_temp" "type=cmd" "hddtemp /dev/sd?" "(température disques)"
|
||||
if [ "$dd_temp_alert" ]; then
|
||||
text+="$dd_temp_alert \n"
|
||||
text+="$dd_temp_alert_text \n"
|
||||
text+="$dd_temp_alert_text \n\n"
|
||||
fi
|
||||
text+='\n'
|
||||
# df, espaces des partitions montées seules
|
||||
text+='`df -h --output=source,target,fstype,size,used,avail,pcent --exclude=tmpfs --exclude=devtmpfs` (utilisation disques) \n'
|
||||
text+='``` \n'
|
||||
text+="$disk_df \n"
|
||||
text+='``` \n\n'
|
||||
f_display "disk_df" "cmd" \
|
||||
"df -h --output=source,target,fstype,size,used,avail,pcent --exclude=tmpfs --exclude=devtmpfs" \
|
||||
"(utilisation disques)"
|
||||
# df -i, inoeuds
|
||||
text+='`df -i --exclude=tmpfs --exclude=devtmpfs` (utilisation inoeuds) \n'
|
||||
text+='``` \n'
|
||||
text+="$disk_df_i \n"
|
||||
text+='``` \n\n'
|
||||
text+='`'"lsblk -o NAME,FSTYPE,SIZE,LABEL,MOUNTPOINT,UUID"'` (disques) \n' # lsblk
|
||||
text+='``` \n'
|
||||
text+="$disk_lsblk \n"
|
||||
text+='``` \n\n'
|
||||
text+='`'"grep -Ev '^[[:blank:]]*#|^$' /etc/fstab"'` (fstab) \n' # fstab
|
||||
text+='``` \n'
|
||||
text+="$fstab \n"
|
||||
text+='``` \n\n'
|
||||
text+='`'"grep -Evs '^[[:blank:]]*#|^$' /etc/initramfs-tools/conf.d/resume"'` (resume) \n' # resume
|
||||
text+='``` \n'
|
||||
if [ "$resume" ]; then
|
||||
text+="$resume \n"
|
||||
else
|
||||
text+="$alert_resume \n"
|
||||
fi
|
||||
text+='``` \n\n'
|
||||
f_display "disk_df_i" "cmd" "df -i --exclude=tmpfs --exclude=devtmpfs" "(utilisation inoeuds)"
|
||||
# lsblk
|
||||
f_display "disk_lsblk" "cmd" "lsblk -o NAME,FSTYPE,SIZE,LABEL,MOUNTPOINT,UUID" "(disques)"
|
||||
# fstab
|
||||
f_display "fstab" "cmd" "grep -Ev '^[[:blank:]]*#|^$' /etc/fstab" "(fstab)"
|
||||
# resume
|
||||
f_display "resume" "cmd" "grep -Evs '^[[:blank:]]*#|^$' /etc/initramfs-tools/conf.d/resume" "(resume)"
|
||||
if [ "$alert_uuidResume" ]; then
|
||||
text+="$alert_uuidResume \n\n"
|
||||
fi
|
||||
echo -e "$text" >> "$fileOutput"
|
||||
}
|
||||
|
||||
fi_dmesg(){ #v2 19/10/2017
|
||||
fi_dmesg(){ #v2 21/10/2017
|
||||
local dmesg_err dmesg_warn dmesg_crit file text nb_lignes=25
|
||||
file="/tmp/$$-$RANDOM-dmesg"
|
||||
[ "$EUID" -eq 0 ] || echo
|
||||
|
@ -494,26 +509,12 @@ fi_dmesg(){ #v2 19/10/2017
|
|||
rm "$file-"*
|
||||
###
|
||||
text="## dmesg kernel (emergency, alerte, erreur, warning ou critique) \n\n"
|
||||
text+='`dmesg -l emerg`'" (**emergency**, $nb_lignes premières lignes) \n"
|
||||
text+='```\n'
|
||||
text+="$dmesg_emerg \n"
|
||||
text+='```\n\n'
|
||||
text+='`dmesg -l alert`'" (**alerte**, $nb_lignes premières lignes) \n"
|
||||
text+='```\n'
|
||||
text+="$dmesg_alert \n"
|
||||
text+='```\n\n'
|
||||
text+='`dmesg -l crit`'" (**critique**, $nb_lignes premières lignes) \n"
|
||||
text+='```\n'
|
||||
text+="$dmesg_crit \n"
|
||||
text+='```\n\n'
|
||||
text+='`dmesg -l err`'" (**erreur**, $nb_lignes premières lignes) \n"
|
||||
text+='```\n'
|
||||
text+="$dmesg_err \n"
|
||||
text+='```\n\n'
|
||||
text+='`dmesg -l warn`'" (**warning**, $nb_lignes premières lignes) \n"
|
||||
text+='```\n'
|
||||
text+="$dmesg_warn \n"
|
||||
text+='```\n\n'
|
||||
# f_display "variable(sans $)" "type=var|cmd|sans" "titrage" "comment_titrage"
|
||||
f_display "dmesg_emerg" "cmd" "dmesg -l emerg" "(**emergency**, $nb_lignes premières lignes)"
|
||||
f_display "dmesg_alert" "cmd" "dmesg -l alert" "(**alerte**, $nb_lignes premières lignes)"
|
||||
f_display "dmesg_crit" "cmd" "dmesg -l crit" "(**critique**, $nb_lignes premières lignes)"
|
||||
f_display "dmesg_err" "cmd" "dmesg -l err" "(**erreur**, $nb_lignes premières lignes)"
|
||||
f_display "dmesg_warn" "cmd" "dmesg -l warn" "(**warning**, $nb_lignes premières lignes)"
|
||||
text+="**les $nb_lignes premières lignes commencent à la date la plus ancienne encore dans les logs kernel** \n\n"
|
||||
echo -e "$text" >> "$fileOutput"
|
||||
}
|
||||
|
@ -570,7 +571,7 @@ fi_hw(){ # 12/10/2017
|
|||
echo -e "$text" >> "$fileOutput"
|
||||
}
|
||||
|
||||
fi_journal(){ # 19/10/2017
|
||||
fi_journal(){ #v2 21/10/2017
|
||||
local jctl_alert_k jctl_crit_k jctl_err_k jctl_warn_k file text nb_lignes=25
|
||||
local jctl_warn_nok
|
||||
[ -x "$(which journalctl)" ] || fi_dmesg # pas systemd, appel dmesg
|
||||
|
@ -605,40 +606,25 @@ fi_journal(){ # 19/10/2017
|
|||
###
|
||||
# kernel
|
||||
text="## journalctl kernel (emergency, alert, erreur, warning ou critique) \n\n"
|
||||
text+='`journalctl --no-hostname --boot 0 -k -p 1`'" (**kernel emergency 0 & alerte 1**, $nb_lignes premières lignes) \n"
|
||||
text+='```\n'
|
||||
text+="$jctl_alert_k \n"
|
||||
text+='```\n\n'
|
||||
text+='`journalctl --no-hostname --boot 0 -k -p 2..2`'" (**kernel critique**, $nb_lignes premières lignes) \n"
|
||||
text+='```\n'
|
||||
text+="$jctl_crit_k \n"
|
||||
text+='```\n\n'
|
||||
text+='`journalctl --no-hostname --boot 0 -k -p 3..3`'" (**kernel erreur**, $nb_lignes premières lignes) \n"
|
||||
text+='```\n'
|
||||
text+="$jctl_err_k \n"
|
||||
text+='```\n\n'
|
||||
text+='`journalctl --no-hostname --boot 0 -k -p 4..4`'" (**kernel warning**, $nb_lignes premières lignes) \n"
|
||||
text+='```\n'
|
||||
text+="$jctl_warn_k \n"
|
||||
text+='```\n\n'
|
||||
# f_display "variable(sans $)" "type=var|cmd|sans" "titrage" "comment_titrage"
|
||||
f_display "jctl_alert_k" "cmd" "journalctl --no-hostname --boot 0 -k -p 1" \
|
||||
"(**kernel emergency 0 & alerte 1**, $nb_lignes premières lignes)"
|
||||
f_display "jctl_crit_k" "cmd" "journalctl --no-hostname --boot 0 -k -p 2..2" \
|
||||
"(**kernel critique**, $nb_lignes premières lignes)"
|
||||
f_display "jctl_err_k" "cmd" "journalctl --no-hostname --boot 0 -k -p 3..3" \
|
||||
"(**kernel erreur**, $nb_lignes premières lignes)"
|
||||
f_display "jctl_warn_k" "cmd" "journalctl --no-hostname --boot 0 -k -p 4..4" \
|
||||
"(**kernel warning**, $nb_lignes premières lignes)"
|
||||
# non kernel
|
||||
text+="## journalctl hors kernel (emergency, alert, erreur, warning ou critique) \n\n"
|
||||
text+='`journalctl --no-hostname --boot 0 -p 1 | grep -v kernel:`'" (**hors kernel emergency 0 & alerte 1**, $nb_lignes premières lignes) \n"
|
||||
text+='```\n'
|
||||
text+="$jctl_alert_nok \n"
|
||||
text+='```\n\n'
|
||||
text+='`journalctl --no-hostname --boot 0 -p 2..2 | grep -v kernel:`'" (**hors kernel critique**, $nb_lignes premières lignes) \n"
|
||||
text+='```\n'
|
||||
text+="$jctl_crit_nok \n"
|
||||
text+='```\n\n'
|
||||
text+='`journalctl --no-hostname --boot 0 -p 3..3 | grep -v kernel:`'" (**hors kernel erreur**, $nb_lignes premières lignes) \n"
|
||||
text+='```\n'
|
||||
text+="$jctl_err_nok \n"
|
||||
text+='```\n\n'
|
||||
text+='`journalctl --no-hostname --boot 0 -p 4..4 | grep -v kernel:`'" (**hors kernel warning**, $nb_lignes premières lignes) \n"
|
||||
text+='```\n'
|
||||
text+="$jctl_warn_nok \n"
|
||||
text+='```\n\n'
|
||||
f_display "jctl_alert_nok" "cmd" "journalctl --no-hostname --boot 0 -p 1 | grep -v kernel:" \
|
||||
"(**hors kernel emergency 0 & alerte 1**, $nb_lignes premières lignes)"
|
||||
f_display "jctl_crit_nok" "cmd" "journalctl --no-hostname --boot 0 -p 2..2 | grep -v kernel:" \
|
||||
"(**hors kernel critique**, $nb_lignes premières lignes)"
|
||||
f_display "jctl_err_nok" "cmd" "journalctl --no-hostname --boot 0 -p 3..3 | grep -v kernel:" \
|
||||
"(**hors kernel erreur**, $nb_lignes premières lignes)"
|
||||
f_display "jctl_warn_nok" "cmd" "journalctl --no-hostname --boot 0 -p 4..4 | grep -v kernel:" \
|
||||
"(**hors kernel warning**, $nb_lignes premières lignes)"
|
||||
text+="**les $nb_lignes premières lignes commencent à la date du dernier boot** \n\n"
|
||||
echo -e "$text" >> "$fileOutput"
|
||||
}
|
||||
|
@ -689,15 +675,12 @@ et/ou installer le démon Ntp: apt install ntp \n"
|
|||
echo -e "$text" >> "$fileOutput"
|
||||
}
|
||||
|
||||
fi_log_xorg(){ #v2 19/10/2017
|
||||
fi_log_xorg(){ #v2 21/10/2017
|
||||
local logXorg xfile extract text nb_lignes=50
|
||||
# Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice,
|
||||
# (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown (WW) warning, (EE) erreur
|
||||
# voir options appliquées par config file: cat /var/log/Xorg.0.log | grep -E '\(\*\*\)'
|
||||
# voir options par défaut: cat /var/log/Xorg.0.log | grep -E '\(==\)'
|
||||
text="## journaux Xorg \n\n"
|
||||
text+='`'"grep -Es '\(WW\)|\(EE\)|\(\?\?\)' /var/log/Xorg.?.log /home/<user>/.local/share/xorg/Xorg.?.log"'` (Xorg.log) \n'
|
||||
text+='```\n'
|
||||
for xfile in /var/log/Xorg.0.log /home/$user_/.local/share/xorg/Xorg.0.log ; do
|
||||
if [ -e "$xfile" ]; then
|
||||
extract="$(grep -Es '\(WW\)|\(EE\)|\(\?\?\)' $xfile | sed '/(WW) warning, (EE) error,/d')"
|
||||
|
@ -713,9 +696,13 @@ fi_log_xorg(){ #v2 19/10/2017
|
|||
logXorg+="$xfile : inexistant\n\n"
|
||||
fi
|
||||
done
|
||||
text+="${logXorg::-2}"
|
||||
text+='```\n\n'
|
||||
echo -e "$text" >> "$fileOutput"
|
||||
logXorg="${logXorg::-2}"
|
||||
###
|
||||
text="## journaux Xorg \n\n"
|
||||
# f_display "variable(sans $)" "type=var|cmd|sans" "titrage" "comment_titrage"
|
||||
f_display "logXorg" "cmd" \
|
||||
"grep -Es '\(WW\)|\(EE\)|\(\?\?\)' /var/log/Xorg.?.log /home/<user>/.local/share/xorg/Xorg.?.log" \
|
||||
"(Xorg.log)"
|
||||
}
|
||||
|
||||
fi_mem(){ # 05/10/2017
|
||||
|
@ -1693,109 +1680,76 @@ figet_shell(){ # thanks neofetch, assigne $fget_shell # 04/10/2017
|
|||
fget_shell="$shell"
|
||||
}
|
||||
|
||||
figet_test__function(){ # 20/10/2017
|
||||
local text
|
||||
text="\`$1 $2\` \n"
|
||||
text+='``` '
|
||||
echo -e "$text" >> "$fileOutput" # flush avant scandir
|
||||
unset text
|
||||
if [ -d "$1" ]; then
|
||||
f__scandir $1 $2
|
||||
else
|
||||
text="$1 inexistant \n"
|
||||
fi
|
||||
text+='``` \n'
|
||||
echo -e "$text" >> "$fileOutput" # flush
|
||||
}
|
||||
|
||||
figet_test_batt(){ # 20/10/2017
|
||||
local text figet_test_rep
|
||||
text="## batterie test \n\n"
|
||||
figet_test_batt(){ # 21/10/2017
|
||||
local text var_temp
|
||||
# matériel
|
||||
figet_dmi
|
||||
f_display "fget_dmi" "sans"
|
||||
text="--- \n\n"
|
||||
###
|
||||
text+="## batterie test \n\n"
|
||||
# acpi éventuel
|
||||
if [ "$(which acpi)" ]; then
|
||||
text+="\`acpi -abi\` \n"
|
||||
text+='``` \n'
|
||||
text+="$(acpi -abi) \n"
|
||||
text+='``` \n'
|
||||
var_temp=$(acpi -abi)
|
||||
f_display "var_temp" "cmd" "acpi -abi"
|
||||
fi
|
||||
echo -e "$text" >> "$fileOutput" # flush
|
||||
# /sys/class/power_supply/
|
||||
figet_test_rep="/sys/class/power_supply/"
|
||||
figet_test__function "$figet_test_rep" 1
|
||||
var_temp="/sys/class/power_supply/"
|
||||
f_display_scandir "$var_temp" 1
|
||||
# fonction script
|
||||
figet_batt
|
||||
text="figet_batt \n"
|
||||
text+='```\n'
|
||||
text+="$fget_batt \n"
|
||||
text+='``` \n'
|
||||
echo -e "$text" >> "$fileOutput" # flush
|
||||
f_display "fget_batt" "var" "figet_batt"
|
||||
}
|
||||
|
||||
figet_test_dmi(){ # 20/10/2017
|
||||
local text figet_test_rep
|
||||
text="## dmi test \n\n"
|
||||
echo -e "$text" >> "$fileOutput" # flush
|
||||
figet_test_dmi(){ # 21/10/2017
|
||||
local text var_temp
|
||||
text+="## dmi test \n\n"
|
||||
# /sys/class/dmi/
|
||||
figet_test_rep="/sys/class/dmi/"
|
||||
figet_test__function "$figet_test_rep" 1
|
||||
var_temp="/sys/class/dmi/"
|
||||
f_display_scandir "$var_temp" 1
|
||||
# fonction script
|
||||
figet_dmi
|
||||
text+="figet_dmi \n"
|
||||
text+='``` \n'
|
||||
text+="$fget_dmi \n"
|
||||
text+='``` \n'
|
||||
echo -e "$text" >> "$fileOutput" # flush
|
||||
f_display "fget_dmi" "var" "figet_dmi"
|
||||
}
|
||||
|
||||
figet_test_hw(){ # 20/10/2017
|
||||
local text hw_test_temp figet_test_rep
|
||||
figet_test_hw(){ # 21/10/2017
|
||||
local text var_temp
|
||||
# matériel
|
||||
figet_dmi
|
||||
f_display "fget_dmi" "sans"
|
||||
text="--- \n\n"
|
||||
###
|
||||
text+="## hwmon test \n\n"
|
||||
echo -e "$text" >> "$fileOutput" # flush
|
||||
# sensors et acpi éventuel
|
||||
unset text
|
||||
if [ "$(which sensors)" ]; then
|
||||
text+="\`sensors -u\` \n"
|
||||
text+='``` \n'
|
||||
text+="$(sensors -u) \n"
|
||||
text+='``` \n'
|
||||
var_temp=$(sensors -u)
|
||||
f_display "var_temp" "cmd" "sensors -u"
|
||||
fi
|
||||
if [ "$(which acpi)" ]; then
|
||||
text+="\`acpi -V\` \n"
|
||||
text+='``` \n'
|
||||
text+="$(acpi -V) \n"
|
||||
text+='``` \n'
|
||||
var_temp=$(acpi -V | grep -E 'Thermal|Cooling')
|
||||
f_display "var_temp" "cmd" "acpi -V"
|
||||
fi
|
||||
echo -e "$text" >> "$fileOutput" # flush
|
||||
# /sys/class/hwmon/
|
||||
figet_test_rep="/sys/class/hwmon/"
|
||||
figet_test__function "$figet_test_rep" 1
|
||||
var_temp="/sys/class/hwmon/"
|
||||
f_display_scandir "$var_temp" 1
|
||||
# /sys/class/thermal/thermal_zone0/
|
||||
figet_test_rep="/sys/class/thermal/thermal_zone0/"
|
||||
figet_test__function "$figet_test_rep" 0
|
||||
var_temp="/sys/class/thermal/thermal_zone0/"
|
||||
f_display_scandir "$var_temp" 0
|
||||
# /sys/devices/platform/coretemp.0/hwmon/
|
||||
figet_test_rep="/sys/devices/platform/coretemp.0/hwmon/"
|
||||
figet_test__function "$figet_test_rep" 1
|
||||
var_temp="/sys/devices/platform/coretemp.0/hwmon/"
|
||||
f_display_scandir "$var_temp" 1
|
||||
# analyse méthode neofetch
|
||||
if [ -f "/sys/class/hwmon/hwmon0/temp1_input" ]; then
|
||||
var_temp="$(< "/sys/class/hwmon/hwmon0/temp1_input")"
|
||||
var_temp="$((var_temp * 100 / 10000))" # 33000 x 100 / 10 000 = 330
|
||||
var_temp="[${var_temp/${var_temp: -1}}.${var_temp: -1}°C]" # formatage 1 point décimal
|
||||
else
|
||||
var_temp=" non accessible"
|
||||
fi
|
||||
f_display "var_temp" "var" "hwmon0/temp1_input ala neofetch"
|
||||
# fonction script
|
||||
figet_hw
|
||||
text="figet_hw \n"
|
||||
text+='```\n'
|
||||
text+="$fget_hw \n"
|
||||
text+='``` \n'
|
||||
echo -e "$text" >> "$fileOutput" # flush
|
||||
# analyse méthode neofetch
|
||||
unset hw_test_temp
|
||||
if [ -f "/sys/class/hwmon/hwmon0/temp1_input" ]; then
|
||||
hw_test_temp="$(< "/sys/class/hwmon/hwmon0/temp1_input")"
|
||||
hw_test_temp="$((hw_test_temp * 100 / 10000))" # 33000 x 100 / 10 000 = 330
|
||||
hw_test_temp="[${hw_test_temp/${hw_test_temp: -1}}.${hw_test_temp: -1}°C]" # formatage 1 point décimal
|
||||
else
|
||||
hw_test_temp=" non accessible"
|
||||
fi
|
||||
text="hwmon0/temp1_input ala neofetch \n"
|
||||
text+='``` \n'
|
||||
text+="$hw_test_temp \n"
|
||||
text+='``` \n'
|
||||
echo -e "$text" >> "$fileOutput" # flush
|
||||
f_display "fget_hw" "var" "figet_hw"
|
||||
}
|
||||
|
||||
figet_wm(){ # thanks neofetch, assigne $fget_wm # 09/10/2017
|
||||
|
@ -2127,7 +2081,7 @@ for j in $options; do
|
|||
case $j in
|
||||
-t | --test )
|
||||
prg_1 "$*"
|
||||
fi_hw
|
||||
fi_disk
|
||||
prg_3
|
||||
exit ;; # test seulement
|
||||
-c* | all )
|
||||
|
|
|
@ -12,6 +12,10 @@
|
|||
|
||||
* f__requis f__wget_test fscript_get_version fscript_update fscript_cronAnacron
|
||||
|
||||
## 2.11.2 21/10/2017
|
||||
|
||||
* révision affichage avec f_display
|
||||
|
||||
## 2.11.1 20/10/2017
|
||||
|
||||
* révision: figet_hw v2, name, label et filtrage 0°C
|
||||
|
|
Loading…
Reference in New Issue