2020-09-02 17:43:48 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-08-27 17:26:49 +03:00
|
|
|
FILES=(getBalances.json validators.json eventsStats.json alerts.json)
|
|
|
|
|
|
|
|
check_files_exist() {
|
|
|
|
rc=0
|
|
|
|
for f in "${FILES[@]}"; do
|
2020-01-10 15:55:35 +03:00
|
|
|
command="test -f responses/bridge/$f"
|
2020-11-04 22:16:43 +03:00
|
|
|
if [[ -z "$MODE" || "$MODE" == native-to-erc ]]; then
|
|
|
|
(docker-compose -f ../e2e-commons/docker-compose.yml exec -T monitor /bin/bash -c "$command") || rc=1
|
|
|
|
fi
|
|
|
|
if [[ -z "$MODE" || "$MODE" == erc-to-erc ]]; then
|
|
|
|
(docker-compose -f ../e2e-commons/docker-compose.yml exec -T monitor-erc20 /bin/bash -c "$command") || rc=1
|
|
|
|
fi
|
|
|
|
if [[ -z "$MODE" || "$MODE" == erc-to-native ]]; then
|
|
|
|
(docker-compose -f ../e2e-commons/docker-compose.yml exec -T monitor-erc20-native /bin/bash -c "$command") || rc=1
|
|
|
|
fi
|
|
|
|
if [[ -z "$MODE" || "$MODE" == amb ]]; then
|
|
|
|
(docker-compose -f ../e2e-commons/docker-compose.yml exec -T monitor-amb /bin/bash -c "$command") || rc=1
|
|
|
|
fi
|
2019-08-27 17:26:49 +03:00
|
|
|
done
|
|
|
|
return $rc
|
|
|
|
}
|
|
|
|
|
|
|
|
i=0
|
|
|
|
until check_files_exist
|
|
|
|
do
|
|
|
|
((i++))
|
|
|
|
if [ "$i" -gt 30 ]
|
|
|
|
then
|
|
|
|
exit -1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Waiting for monitor to start..."
|
|
|
|
sleep 3
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "Monitor started"
|