-
Notifications
You must be signed in to change notification settings - Fork 0
/
hwtest.sh
55 lines (33 loc) · 1.76 KB
/
hwtest.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
45
46
47
48
49
50
51
#!/bin/bash
yum install -y inxi
yum install -y memtester
yum install -y mailx
touch /tmp/hard.txt
echo 'set [email protected] smtp=smtp.ttyongche.com' >> /etc/mail.rc
echo 'set [email protected] smtp-auth-password=wzy789789' >> /etc/mail.rc
echo 'set smtp-auth=login' >> /etc/mail.rc
echo -e "系统及内核版本 \n==========================================================================" >> /tmp/hard.txt
cat /etc/issue | head -1 >> /tmp/hard.txt
uname -r >> /tmp/hard.txt
echo -e "硬件概要 \n==========================================================================" >> /tmp/hard.txt
inxi -c 5 -b >> /tmp/hard.txt
echo -e "详细概要 \n==========================================================================" >> /tmp/hard.txt
inxi -F >> /tmp/hard.txt
echo -e "CPU信息 \n==========================================================================" >> /tmp/hard.txt
lscpu >> /tmp/hard.txt
echo -e "MEM信息 \n==========================================================================" >> /tmp/hard.txt
cat /proc/meminfo >> /tmp/hard.txt
echo -e "磁盘信息 \n==========================================================================" >> /tmp/hard.txt
lsblk >> /tmp/hard.txt
echo -e "磁盘分区信息 \n==========================================================================" >> /tmp/hard.txt
fdisk -l >> /tmp/hard.txt
echo -e "BIOS信息 \n==========================================================================" >> /tmp/hard.txt
dmidecode -t bios >> /tmp/hard.txt
hname=`hostname`
cat /tmp/hard.txt | mail -s $hname [email protected]
#set [email protected]
#set smtp=smtp.163.com
#set [email protected]
#set smtp-auth-password=zty2016
##set smtp-auth-password=zty2016%
#set smtp-auth=login