mirror of https://framagit.org/kyodev/kyopages.git
0.9.1
This commit is contained in:
parent
9bdb7807d1
commit
993725bf82
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
version=0.9.0
|
||||
version=0.9.1
|
||||
date="06/08/2017"
|
||||
projet="simpledeb"
|
||||
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues"
|
||||
|
@ -376,12 +376,12 @@ get_gpu() { # thanks neofetch, assigne $gpu
|
|||
|
||||
get_ip() { # $ip_local, $gateway, $gateway_type, $gateway_one, $ip_local, $ip_local_type, $ifname, $ifname_type
|
||||
gateway=$(ip route | awk '/default.*via/ {print $3, "pour:", $5}')
|
||||
gateway_type=$(sed 's/\(^.*wl.*\)/\1 (wifi)/;s/\(^.*en.*\)/\1 (ethernet)/' <<< $gateway)
|
||||
gateway_one=$(head -n 1 <<< $gateway | awk '{print $1}')
|
||||
ip_local=$(ip route | awk '/proto.*src/ {print $9, "pour:",$3}')
|
||||
ip_local_type=$(sed 's/\(^.*wl.*\)/\1 (wifi)/;s/\(^.*en.*\)/\1 (ethernet)/' <<< $ip_local)
|
||||
ifname=$(ip route | awk '/proto.*src/ {print $3}')
|
||||
ifname_type=$(sed 's/\(^wl.*\)/\1 (wifi)/;s/\(^en.*\)/\1 (ethernet)/' <<< $ifname)
|
||||
gateway_type=$(sed -E 's/(^.*wl.*)/\1 (wifi)/;s/(^.*en.*|^.*eth.µ)/\1 (ethernet)/' <<< $gateway)
|
||||
ip_local_type=$(sed -E 's/(^.*wl.*)/\1 (wifi)/;s/(^.*en.*|^.*eth.*)/\1 (ethernet)/' <<< $ip_local)
|
||||
ifname_type=$(sed -E 's/(^wl.*)/\1 (wifi)/;s/(^en.*|^eth.*)/\1 (ethernet)/' <<< $ifname)
|
||||
}
|
||||
|
||||
get_ip_public(){ # $1=IPv4|IPv6, assigne $ip_public
|
||||
|
@ -618,7 +618,7 @@ fi_dmesg(){ # root only, si $1=dmesg rapport dmesg only
|
|||
f__info "$RED""dmesg ne peut être affiché qu'avec les droits root"
|
||||
return 1
|
||||
fi
|
||||
text+="ne peut être affiché qu'avec les droits root"
|
||||
text+="ne peut être affiché qu'avec les droits root\n"
|
||||
echo -e "$text" >> "$fileOutput"
|
||||
return 0
|
||||
fi
|
||||
|
@ -656,8 +656,8 @@ fi_disk(){
|
|||
local disk_lsblk=$(lsblk -fi -o +SIZE -o +OWNER)
|
||||
local 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")
|
||||
local resume=$(grep -Ev '#|^$' /etc/initramfs-tools/conf.d/resume)
|
||||
local idSwap=$(grep -vE '#|^$' /etc/fstab | grep -E 'swap' | grep 'UUID' | sed -E 's/^UUID=([0-9a-Z-]*).*/\1/')
|
||||
local idResume=$(grep -Ev '#|^$' /etc/initramfs-tools/conf.d/resume | grep 'RESUME=' | grep 'UUID' | sed -E 's/^UUID=([0-9a-Z-]*).*/\1/')
|
||||
local idSwap=$(grep -vE '#|^$' /etc/fstab | grep 'swap' | grep 'UUID' | sed -E 's/^UUID=([0-9a-Z-]*).*/\1/')
|
||||
local idResume=$(grep -Ev '#|^$' /etc/initramfs-tools/conf.d/resume | grep 'RESUME=' | grep 'UUID' | sed -E 's/^.*UUID=([0-9a-Z-]*).*/\1/')
|
||||
local diskAta=$(ls -l /dev/disk/by-id/ | awk '{ print $9, $11 }' | sed '/^ata/!d; /part/d; /\/sd/!d; s/^.*\(sd..*\)$/\1/')
|
||||
local diskUsb=$(ls -l /dev/disk/by-id/ | awk '{ print $9, $11 }' | sed '/^usb/!d; /part/d; /\/sd/!d; s/^.*\(sd..*\)$/\1/')
|
||||
local diskMmc=$(ls -l /dev/disk/by-id/ | awk '{ print $9, $11 }' | sed '/^mmc/!d; /part/d; /\/mmcblk/!d; s/^.*\(mmcblk..*\)$/\1/')
|
||||
|
@ -694,13 +694,13 @@ fi_disk(){
|
|||
fi_gpu(){
|
||||
# local graphCards=$(lspci -nnk | grep -iEA 3 'vga|display|3d')
|
||||
local graphCards=$(lspci -nnvvv | grep -iEA 13 '^[0-9]+.*vga|display|3d')
|
||||
local extraitXorg=$(grep -E '\(WW\)|\(EE\)|\(NI\)|\(\?\?\)' /var/log/Xorg.*.log /home/$user_/.local/share/xorg/Xorg.*.log)
|
||||
local extraitXorg=$(grep -E '\(WW\)|\(EE\)|\(NI\)|\(\?\?\)' /var/log/Xorg.*.log /home/$user_/.local/share/xorg/Xorg.*.log 2>/dev/null)
|
||||
local resolutions=$(xrandr --query | grep '^ *[0-9]' | head -n 10)
|
||||
|
||||
local text="## graphisme \n\n"
|
||||
get_gpu; text+="**GPU: $gpu** \n"
|
||||
get_resolution; text+="**résolution: $resolution** \n\n"
|
||||
text+="\n**lspci -nnk | grep -iEA 3 'vga|display|3d'** (matériel) \n"
|
||||
text+="\n**lspci -nnvvv | grep -iEA 13 '^[0-9]+.*vga|display|3d'** (matériel) \n"
|
||||
text+='```\n'
|
||||
text+="$graphCards \n"
|
||||
text+='```\n'
|
||||
|
@ -824,6 +824,11 @@ fi_reseau(){
|
|||
text+='```\n'
|
||||
text+="$ip_local_type \n"
|
||||
text+='```\n'
|
||||
if grep -q 'wlx' <<< "$ifname"; then
|
||||
text+="**Attention:** une interface wifi est en erreur: $(grep -o 'wlp1s0' <<< $ifname) \n"
|
||||
text+="l'interface n'est pas reconnue et est donc mal nommée \n"
|
||||
text+="au pire, changer le renommage: https://kyodev.frama.io/kyopages/trucs/interfaces-nommage-classique/ \n\n"
|
||||
fi
|
||||
text+="**Passerelle(s):** \n"
|
||||
text+='```\n'
|
||||
text+="$gateway \n"
|
||||
|
@ -929,7 +934,7 @@ fi_systeme(){
|
|||
text+="uname: $uname \n"
|
||||
text+="$bootImage \n"
|
||||
get_resolution; text+="résolution: $resolution \n"
|
||||
text+="serveur xorg: $xorg \n"
|
||||
text+="serveur d'affichage: $xorg \n"
|
||||
get_de; text+="desktop (DE): $de \n"
|
||||
get_wm; text+="window manager: $wm \n"
|
||||
get_shell; text+="shell actif: $shell \n"
|
||||
|
@ -990,9 +995,19 @@ fileLogs="/var/log/sdeb_$script.log"
|
|||
dureePaste=1 # en jour
|
||||
|
||||
prg_1(){ # début
|
||||
f__requis "curl gawk"
|
||||
# f__requis "gawk"
|
||||
fi__context
|
||||
}
|
||||
prg_test(){ # traitements principaux
|
||||
os=$(uname -s)
|
||||
hote=$(uname -n)
|
||||
dateRapport=$(date +"%d %b %Y %H:%M %z")
|
||||
|
||||
echo -e "# getInfo $version sur $hote / $os \n" >> "$fileOutput"
|
||||
echo -e "Rapport au $dateRapport \n" >> "$fileOutput"
|
||||
fi_systeme
|
||||
# fi_reseau
|
||||
}
|
||||
prg_2(){ # traitements principaux
|
||||
os=$(uname -s)
|
||||
hote=$(uname -n)
|
||||
|
@ -1057,16 +1072,6 @@ done
|
|||
printf $COLOR
|
||||
exit
|
||||
|
||||
prg_2(){ # traitements principaux
|
||||
os=$(uname -s)
|
||||
hote=$(uname -n)
|
||||
dateRapport=$(date +"%d %b %Y %H:%M %z")
|
||||
|
||||
echo -e "# getInfo $version sur $hote / $os \n" >> "$fileOutput"
|
||||
echo -e "Rapport au $dateRapport \n" >> "$fileOutput"
|
||||
fi_systeme
|
||||
}
|
||||
|
||||
bug markdownshare:
|
||||
'```' pas interprêté en <pre><code>
|
||||
|
||||
|
|
Loading…
Reference in New Issue