Commit 2f8de2ff authored by kyodev's avatar kyodev

tests/debug_gi 1.0.0

parent 8d4d9066
Pipeline #46761 failed with stage
in 17 seconds
#!/bin/sh
# shellcheck disable=SC2016
version=0.9.0
date="08/04/2018"
script=$(basename $0)
version=1.0.0
# date="08/04/2018"
script=$( basename "$0" )
output="$script.md"
ligneRapport="Rapport du $(date '+%d/%m/%Y %H:%M %z')$(uname -n)$0 $*$script $version"
echo
if [[ "$1" == "--help" || "$1" == "-h" ]] ; then
if [ "$1" = "--help" ] || [ "$1" = "-h" ] ; then
echo "$script [options]"
echo
echo " -h --help : cet affichage"
......@@ -17,132 +18,132 @@ if [[ "$1" == "--help" || "$1" == "-h" ]] ; then
echo
fi
if ! type -p curl &>/dev/null; then
if ! command -v curl 1>/dev/null 2>&1 ; then
echo "Erreur critique: curl requis mais non installé"
if type -p "dpkg" &>/dev/null ; then
if command -v "dpkg" 1>/dev/null 2>&1 ; then
echo " apt install curl"
fi
echo
noexport="yes"
fi
if [[ "$1" == "--noexport" || "$1" == "-n" ]] ; then
if [ "$1" = "--noexport" ] || [ "$1" = "-n" ] ; then
noexport="yes"
fi
exec 3>&1 # sauvegarde
exec 1>"$output" # redirection stdout dans fichier
echo -e "$ligneRapport\n"
printf "%s\n\n\n" "$ligneRapport"
echo '```'
# système, portabilité
bash --version &>/dev/null && bash --version | head -n1 || echo "bash KO"
free --version &>/dev/null && free --version || echo "free KO"
uptime --version &>/dev/null && uptime --version || echo "uptime KO"
lsblk --version &>/dev/null && lsblk --version || echo "lsblk KO"
lspci --version &>/dev/null && lspci --version || echo "lspci KO"
if lspci -nnv &>/dev/null ; then echo "lspci -nnk ok"
bash --version 1>/dev/null 2>&1 && bash --version | head -n1 || echo "bash KO"
free --version 1>/dev/null 2>&1 && free --version || echo "free KO"
uptime --version 1>/dev/null 2>&1 && uptime --version || echo "uptime KO"
lsblk --version 1>/dev/null 2>&1 && lsblk --version || echo "lsblk KO"
lspci --version 1>/dev/null 2>&1 && lspci --version || echo "lspci KO"
if lspci -nnv 1>/dev/null 2>&1 ; then echo "lspci -nnk ok"
else
echo "lspci -nnk KO"
flag_lspci="ko"
fi
journalctl --version &>/dev/null && journalctl --version || echo "journalctl KO"
xargs --version &>/dev/null && xargs --version | head -n1 || echo "xargs KO"
upower --version &>/dev/null || echo "upower KO"
journalctl --version 1>/dev/null 2>&1 && journalctl --version || echo "journalctl KO"
xargs --version 1>/dev/null 2>&1 && xargs --version | head -n1 || echo "xargs KO"
upower --version 1>/dev/null 2>&1 || echo "upower KO"
[ -e '/etc/shells' ] && echo "/etc/shells existe" || echo "/etc/shells KO"
# xorg, video
x-window-manager --version &>/dev/null && x-window-manager --version | head -n1 || echo "x-window-manager KO"
xset -version &>/dev/null && xset -version || echo "xset KO"
xdpyinfo -version &>/dev/null && xdpyinfo -version || echo "xdpyinfo KO"
type -p glxinfo &>/dev/null && echo "glxinfo ok" || echo "glxinfo KO"
xdriinfo nscreens &>/dev/null || echo "xdriinfo KO"
type -p xprop &>/dev/null || echo "xprop KO"
x-window-manager --version 1>/dev/null 2>&1 && x-window-manager --version | head -n1 || echo "x-window-manager KO"
xset -version 1>/dev/null 2>&1 && xset -version || echo "xset KO"
xdpyinfo -version 1>/dev/null 2>&1 && xdpyinfo -version || echo "xdpyinfo KO"
command -v glxinfo 1>/dev/null 2>&1 && echo "glxinfo ok" || echo "glxinfo KO"
xdriinfo nscreens 1>/dev/null 2>&1 || echo "xdriinfo KO"
command -v xprop 1>/dev/null 2>&1 || echo "xprop KO"
# hardware
type -p acpi &>/dev/null && acpi --version | head -n1 || echo "acpi KO"
command -v acpi 1>/dev/null 2>&1 && acpi --version | head -n1 || echo "acpi KO"
echo -e '```\n\n'
printf "%s\n\n" '```'
# upower
if upower --version &>/dev/null ; then
if upower --version 1>/dev/null 2>&1 ; then
echo "## upower"
echo -e '```'
printf "%s\n" '```'
upower --enumerate
upower --version || echo "upower KO"
echo -e '```\n'
printf "%s\n\n" '```'
fi
# xdriinfo Direct Rendering Interface?
if xdriinfo nscreens &>/dev/null ; then
echo "## "$( xdriinfo -version 2>/dev/null )
if xdriinfo nscreens 1>/dev/null 2>&1 ; then
echo "## $( xdriinfo -version 2>/dev/null )"
echo '```'
echo xdriinfo: $( xdriinfo 2>/dev/null )
echo xdriinfo nscreens: $( xdriinfo nscreens 2>/dev/null )
echo xdriinfo driver 0: $( xdriinfo driver 0 2>/dev/null )
echo xdriinfo options $(xdriinfo options 0 2>/dev/null): $( xdriinfo options $(xdriinfo options 0 2>/dev/null) 2>/dev/null )
echo -e '```\n'
echo "xdriinfo: $( xdriinfo 2>/dev/null )"
echo "xdriinfo nscreens: $( xdriinfo nscreens 2>/dev/null )"
echo "xdriinfo driver 0: $( xdriinfo driver 0 2>/dev/null )"
echo "xdriinfo options $(xdriinfo options 0 2>/dev/null): $( xdriinfo options "$(xdriinfo options 0 2>/dev/null)" 2>/dev/null )"
printf "%s\n\n" '```'
fi
# xprop
if type -p xprop &>/dev/null; then
if command -v xprop 1>/dev/null 2>&1; then
# wm / compositor
id=$( xprop -root -notype _NET_SUPPORTING_WM_CHECK 2>/dev/null )
id=${id##* }
wm_brut=$( xprop -id "$id" -notype -len 100 2>/dev/null )
# wm annexe
xprop=$( xprop -root -notype -display $DISPLAY 2>/dev/null )
xprop="$( xprop -root -notype -display "$DISPLAY" 2>/dev/null )"
echo "## xprop"
echo -e '```'
printf "%s\n" '```'
echo "### xprop -id :"
echo "$wm_brut"
echo
echo "### xprop -root -notype -display $DISPLAY :"
echo "$xprop"
echo -e '```\n'
printf "%s\n\n" '```'
fi
# /usr/share/xsessions
echo "## ls -l /usr/share/xsessions "
echo '```'
ls -l /usr/share/xsessions 2>/dev/null
echo -e '```\n'
printf "%s\n\n" '```'
# cpuinfo
echo "## vendor id cpuinfo "
echo '```'
grep -m1 -A3 'vendor_id' /proc/cpuinfo
echo -e '```\n'
printf "%s\n\n" '```'
# général, wm annexe
echo "## ps -ef"
echo '```'
ps -ef
echo -e '```\n'
printf "%s\n\n" '```'
# panel
echo "## ps -e"
echo '```'
ps -A
echo -e '```\n'
printf "%s\n\n" '```'
# env
echo "## env"
echo '```'
env | sort
echo -e '```\n'
printf "%s\n\n" '```'
if [[ -z flag_lspci ]]; then
if [ -z "$flag_lspci" ]; then
# lspci
echo "## lspci -nnk"
echo '```'
lspci -nnk
echo -e '```\n'
printf "%s\n\n" '```'
fi
exec 1>&3 # restauration
exec 3>&- # fermeture FD
if [ -z "$noexport" ]; then
echo -e "url du rapport:\n"
echo $( curl -s --upload-file $output https://transfer.sh/$output )
printf "%s \n\n" "url du rapport:"
curl -s --upload-file "$output" "https://transfer.sh/$output"
echo
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment