-
Notifications
You must be signed in to change notification settings - Fork 4
/
fire.sh
executable file
·54 lines (45 loc) · 944 Bytes
/
fire.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
#!/bin/bash
main(){
local COLOR_GREEN=$'\e[1;32m'
local RESET_COLOR=$'\e[0m'
echo "${COLOR_GREEN}Firing via CyberReaper...${RESET_COLOR}"
./watchForInstancesStart.sh &&
./watchForSSHStart.sh || exit 1
fireFromStockholm &
fireFromFrankfurt &
wait
}
fireFromStockholm(){
local STOCKHOLM_INSTANCES_IPS=`./getInstancesIPs.sh -s`
for ip in ${STOCKHOLM_INSTANCES_IPS}
do
fire "key-stockholm-0.pem" ${ip} &
done
wait
}
fireFromFrankfurt(){
local FRANKFURT_INSTANCES_IPS=`./getInstancesIPs.sh -f`
for ip in ${FRANKFURT_INSTANCES_IPS}
do
fire "key-frankfurt-0.pem" ${ip} &
done
wait
}
fire(){
local KEY=${1}
local IP=${2}
shift 2
echo " 🔥 ${IP}"
ssh \
-i ${KEY} \
-o "LogLevel ERROR" \
-o "IdentitiesOnly yes" \
-o "StrictHostKeyChecking no" \
-o "UserKnownHostsFile /dev/null" \
"ubuntu@${IP}" \
screen -dm \
sudo docker run \
--rm \
--pull always egideon/cyber-reaper:latest
}
main