-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdmitop
More file actions
executable file
·48 lines (39 loc) · 1.19 KB
/
dmitop
File metadata and controls
executable file
·48 lines (39 loc) · 1.19 KB
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
45
46
47
48
#!/bin/bash
#
# dmitop
usagestr="
$(basename $0)
Show the following information about the system
BIOS Information
Vendor
Version
Revision (if any)
Release Date
System Information
Manufacturer
Product Name
Version
Serial Number
"
userstr="
Must be root to invoke $(basename $0)
"
[ $(id -u) -eq 0 ] || { echo "$userstr"; exit 1; }
[ "$1" == "-h" ] && { echo -e "$usagestr"; exit 1; }
dmi=$(dmidecode)
printnext=false
echo
while IFS= read line; do
[[ "$line" == "Handle"* ]] && { printnext=false; }
[[ "$line" == "BIOS Information"* ]] && { echo "$line"; printnext=true; }
[[ "$line" == "System Information"* ]] && { echo "$line"; printnext=true; }
[[ "$line" == *"Vendor"* ]] && $printnext && echo -e "$line"
[[ "$line" == *"Firmware"* ]] && $printnext && echo -e "$line"
[[ "$line" == *"Revision"* ]] && $printnext && echo -e "$line"
[[ "$line" == *"Version"* ]] && $printnext && echo -e "$line"
[[ "$line" == *"Release"* ]] && $printnext && echo -e "$line"
[[ "$line" == *"Manufacturer"* ]] && $printnext && echo -e "$line"
[[ "$line" == *"Product Name"* ]] && $printnext && echo -e "$line"
[[ "$line" == *"Serial Number"* ]] && $printnext && echo -e "$line"
done <<< "$dmi"
echo