This commit is contained in:
kyodev 2017-09-16 14:25:36 +02:00
parent bdf5f19dfb
commit 3573056096
2 changed files with 38 additions and 14 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
version=1.18.0
date="15/09/2017"
version=1.19.0
date="16/09/2017"
projet="simpledeb"
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
script="getInfo"
@ -261,8 +261,8 @@ fi_cpu(){ # 30/08/2017
echo -e "$text" >> "$fileOutput"
}
fi_disk(){ # 14/09/2017
local fstab disk_lsblk utilDisk resume idResume idSwap diskAta diskUsb diskMmc diskNvme text
fi_disk(){ # 16/09/2017
local fstab disk_lsblk utilDisk resume idResume idSwap diskAta diskUsb diskMmc diskNvme alert_uuidResume text
fstab="$(grep -vE '#|^$' /etc/fstab)"
disk_lsblk="$(lsblk -fi -o +SIZE -o +OWNER)"
utilDisk="$(df -h --output=source,target,fstype,size,used,avail,pcent --exclude=tmpfs --exclude=devtmpfs --exclude=devtmpfs | grep -Ev "devpts|none|proc|sys|tmpfs|udev")"
@ -270,6 +270,11 @@ fi_disk(){ # 14/09/2017
# idResume="$(grep -Ev '#|^$' /etc/initramfs-tools/conf.d/resume | sed -En 's/^[^[:blank:]{1,}][^#{1,}].*UUID=(.*)$/\1/p')"
idResume="$(grep -Ev '#|^$' /etc/initramfs-tools/conf.d/resume | sed -En 's/.*UUID=([0-9a-Z-]*).*$/\1/p')"
idSwap="$(grep -Ev '#|^$' /etc/fstab | sed -En 's/^UUID=([0-9a-Z-]*).*swap.*$/\1/p')"
if [ "$idSwap" ] && [ "$idResume" ] && [ "$idSwap" != "$idResume" ]; then
alert_uuidResume+="id swap : $idSwap
id resume: $idResume
_vérifier la config resume_, l'UUID ne correspond pas à celui du swap. En cas de multi-boot. vous pouvez utiliser _RESUME=auto_ ou _RESUME=/dev/sdx_ \n\n"
fi
diskAta="$(ls -l /dev/disk/by-id/ | awk '{ print $9, $11 }' | sed '/^ata/!d; /part/d; /\/sd/!d; s/^.*\(sd..*\)$/\1/')"
diskUsb="$(ls -l /dev/disk/by-id/ | awk '{ print $9, $11 }' | sed '/^usb/!d; /part/d; /\/sd/!d; s/^.*\(sd..*\)$/\1/')"
diskMmc="$(ls -l /dev/disk/by-id/ | awk '{ print $9, $11 }' | sed '/^mmc/!d; /part/d; /\/mmcblk/!d; s/^.*\(mmcblk..*\)$/\1/')"
@ -293,11 +298,7 @@ fi_disk(){ # 14/09/2017
text+='```\n'
text+="$resume \n"
text+='```\n\n'
if [ "$idSwap" ] && [ "$idResume" ] && [ "$idSwap" != "$idResume" ]; then
text+="id swap : $idSwap \n"
text+="id resume: $idResume \n"
text+="_vérifier la config resume_, l'UUID ne correspond pas à celui du swap. en cas de multi-boot. vous pouvez utiliser _RESUME=auto_ ou _RESUME=/dev/sdx_ \n\n"
fi
[ "$alert_uuidResume" ] && text+="$alert_uuidResume \n"
text+="**types de disque** \n\n"
[ "$diskAta" ] || diskAta="-"; text+="* ata: $diskAta \n"
[ "$diskUsb" ] || diskUsb="-"; text+="* usb: $diskUsb \n"
@ -386,10 +387,21 @@ fi_gpu(){ # 30/08/2017
echo -e "$text" >> "$fileOutput"
}
fi_localisation(){ # 30/08/2017
local locale timezone keymap keyboard text
fi_localisation(){ # 16/09/2017
local locale timezone keymap keyboard timedatectl alert_Rtc alert_Rtc_info alert_NTP alert_Ntp_info text
locale="$(grep -vE '#|^$' /etc/default/locale)"
timezone="$(cat /etc/timezone)"
if [ "$(which timedatectl)" ]; then
timedatectl="$(timedatectl status --no-pager)"
grep -q 'RTC in local TZ: yes' <<< "$timedatectl" && alert_Rtc="Attention RTC in local TZ"
alert_Rtc_info="**Lhorloge système doit être en UTC** pour que les applications de date et heure fonctionnent
correctement avec le fuseau horaire configuré sur le système. Les modifications dheure
dété/hiver peuvent être incohérentes quand lhorloge matérielle est en heure locale. \n"
grep -q 'Network time on: no' <<< "$timedatectl" && alert_NTP="Attention NTP"
alert_Ntp_info="Le système ne synchronise pas l'heure sur un serveur NTP. Si ce n'est pas voulu:
activer le service: timedatectl set-ntp true
et/ou installer le démon Ntp: apt install ntp \n"
fi
keymap="$(setxkbmap -query)"
keyboard="$(grep -vE '#|^$' /etc/default/keyboard)"
###
@ -401,8 +413,16 @@ fi_localisation(){ # 30/08/2017
text+="**cat /etc/timezone** \n"
text+='```\n'
text+="$timezone \n"
text+='```\n\n'
text+="**setxkbmap -query** \n"
text+='```\n'
if [ "$timedatectl" ]; then
text+="**timedatectl status --no-pager** \n"
text+='```\n'
text+="$timedatectl \n"
text+='```\n'
fi
[ "$alert_Rtc" ] && text+="$alert_Rtc_info \n"
[ "$alert_Ntp" ] && text+="$alert_Ntp_info \n"
text+="\n**setxkbmap -query** \n"
text+='```\n'
text+="$keymap \n"
text+='```\n\n'
@ -1159,7 +1179,6 @@ prg_1(){ # début
prg_2(){ # traitements principaux
printf "."
fi_systeme; printf "."
# [ -e "$fileDev" ] && return
fi_cpu; printf "."
fi_gpu; printf "."
fi_localisation; printf "."

View File

@ -2,6 +2,11 @@
## todo
## 1.19.0 16/09/2017
* timedatectl dans localisation et alertes horloge RTC et Ntp
* révision mineure fi_disk, variable alert_
## 1.18.0 15/09/2017
* correction suppression code gui-dialog en dev