-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.bash
72 lines (51 loc) · 1.19 KB
/
run.bash
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# !/bin/bash
# Log JBOF Nvme SSD number
#
# 2019-07-22 12:00:00 Add 300 loop & Date_Time Info
# 2019-07-22 10:04:59 luke.chen
IP=192.168.0.41
if [ "$1" == "" ]
then
echo You forget input IP "(use defult 192.168.0.41 )"
else
IP=192.168.$1
fi
sleep_time=3
Start_DAY=$(date +"%Y-%m-%d_%H%M%S")
echo "" > log_$Start_DAY.txt
###
# Save First Log File(base.txt)
###
file="base.txt"
if [ -f "$file" ]
then
echo base.txt is EXIST !!!
else
# sleep
sleep $sleep_time
TODAY=$(date +"%H:%M:%S %d/%m/%Y")
echo NO. 000 $TODAY | tee -a log_$Start_DAY.txt
./plink -no-antispoof -l root $IP lspci | grep No | tee -a log_$Start_DAY.txt base.txt
# sleep
sleep $sleep_time
fi
###
# Loop 300 times
###
for Run_count in $(seq -f "%03g" 1 300)
do
# sleep
sleep $sleep_time
./plink -no-antispoof -l root $IP lspci | grep No > $Run_count.txt
TODAY=$(date +"%H:%M:%S %d/%m/%Y")
DIFF=$(diff base.txt $Run_count.txt)
if [ "$DIFF" != "" ]
then
echo NO. $Run_count "FAIL" $TODAY | tee -a log_$Start_DAY.txt
else
echo NO. $Run_count "PASS" $TODAY | tee -a log_$Start_DAY.txt
fi
cat $Run_count.txt | tee -a log_$Start_DAY.txt
# sleep
sleep $sleep_time
done