-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.sh
73 lines (59 loc) · 2.6 KB
/
test.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
send_beacon_messages() {
mqtt pub -t federator/beacon/s/generic -m "test message" -h localhost -p 1880
mqtt pub -t federator/beacon/s/generic -m "test message" -h localhost -p 1881
mqtt pub -t federator/beacon/s/generic -m "test message" -h localhost -p 1882
mqtt pub -t federator/beacon/s/generic -m "test message" -h localhost -p 1883
mqtt pub -t federator/beacon/s/generic -m "test message" -h localhost -p 1884
mqtt pub -t federator/beacon/generictest -m "test message" -h localhost -p 1880
mqtt pub -t federator/beacon/generictest -m "test message" -h localhost -p 1881
mqtt pub -t federator/beacon/generictest -m "test message" -h localhost -p 1882
mqtt pub -t federator/beacon/generictest -m "test message" -h localhost -p 1883
mqtt pub -t federator/beacon/generictest -m "test message" -h localhost -p 1884
mqtt pub -t federator/beacon/s/data -m "test message" -h localhost -p 1884
mqtt pub -t federator/beacon/s/data -m "test message" -h localhost -p 1885
mqtt pub -t federator/beacon/s/data -m "test message" -h localhost -p 1886
mqtt pub -t federator/beacon/s/data -m "test message" -h localhost -p 1887
mqtt pub -t federator/beacon/s/data -m "test message" -h localhost -p 1888
mqtt pub -t federator/beacon/datatest -m "test message" -h localhost -p 1884
mqtt pub -t federator/beacon/datatest -m "test message" -h localhost -p 1885
mqtt pub -t federator/beacon/datatest -m "test message" -h localhost -p 1886
mqtt pub -t federator/beacon/datatest -m "test message" -h localhost -p 1887
mqtt pub -t federator/beacon/datatest -m "test message" -h localhost -p 1888
echo "Sent beacon messages"
}
# Função para enviar mensagens repetidamente por 1.5 segundos
send_repeated_messages() {
for ((i=1; i<=20; i++)); do
mqtt pub -t federated/s/generic -m "test message" -h localhost -p 1884
mqtt pub -t federated/s/data -m "test message" -h localhost -p 1884
mqtt pub -t federated/generictest -m "test message" -h localhost -p 1884
mqtt pub -t federated/datatest -m "test message" -h localhost -p 1884
echo "Sent $i repeated messages"
done
}
echo "Starting round"
send_beacon_messages
sleep 15
send_beacon_messages
sleep 15
send_beacon_messages
sleep 5
send_repeated_messages
echo "Ended round 1"
send_beacon_messages
sleep 10
send_repeated_messages
echo "Ended round 2"
send_beacon_messages
sleep 10
send_repeated_messages
echo "Ended round 3"
send_beacon_messages
sleep 10
send_repeated_messages
echo "Ended round 4"
send_beacon_messages
sleep 10
send_repeated_messages
echo "Ended round 5"