status-go/_assets/scripts/canary_test_mailservers.sh
Jakub Sokołowski 5aa9eb913d
fix: drop unnecessary wrappers, fix shebangs
Also make the hook installation run by default.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-11-07 18:02:06 +01:00

21 lines
577 B
Bash
Executable File

#!/usr/bin/env bash
json_path='.ClusterConfig.TrustedMailServers'
mailservers=$(jq -r "${json_path} | .[]" $1)
count=$(jq -r "${json_path} | length" $1)
echo "Will test ${count} mailservers..."
failed_count=0
while read -r mailserver; do
echo "Testing $mailserver ..."
./build/bin/node-canary -log=ERROR -log-without-color=true -mailserver $mailserver || failed_count=$((failed_count + 1))
done <<< "$mailservers"
if [ $failed_count -gt 0 ]; then
echo "${failed_count}/${count} mailservers failed the test"
exit 1
else
echo "All mailservers replied correctly"
fi