forked from Dunedan/mbp-2016-linux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-info.sh
executable file
·44 lines (33 loc) · 896 Bytes
/
get-info.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
if ! [ -x "$(command -v hwinfo)" ]; then
echo "Can't find hwinfo. Please install it." >&2
exit 1
fi
if ! [ -x "$(command -v acpidump)" ]; then
echo "Can't find acpidump. Please install it." >&2
exit 1
fi
name=$(</sys/class/dmi/id/product_name)
dir="${0%/*}/$name"
mkdir -p "$dir"
echo "getting EDID for card0-eDP-1"
cp /sys/class/drm/card0-eDP-1/edid "$dir"/card0-eDP-1.edid
echo "getting dmesg"
sudo dmesg > "$dir"/dmesg
echo "getting hwinfo"
sudo hwinfo > "$dir"/hwinfo.txt
echo "getting lspci"
sudo lspci -vvnn > "$dir"/lspci
echo "getting lsusb"
sudo lsusb -v > "$dir"/lsusb
echo "getting Xorg.log"
user_log=~/.local/share/xorg/Xorg.0.log
global_log=/var/log/Xorg.0.log
if [ $user_log -nt $global_log ]; then
cp $user_log "$dir"/Xorg.0.log
else
cp $global_log "$dir"/Xorg.0.log
fi
echo "getting ACPI tables"
sudo acpidump > "$dir"/acpidump
echo "done!"