github.com/status-im/status-go@v1.1.0/_assets/scripts/canary_test_mailservers.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  json_path='.ClusterConfig.TrustedMailServers'
     4  mailservers=$(jq -r "${json_path} | .[]" $1)
     5  count=$(jq -r "${json_path} | length" $1)
     6  
     7  echo "Will test ${count} mailservers..."
     8  failed_count=0
     9  
    10  while read -r mailserver; do
    11    echo "Testing $mailserver ..."
    12    ./build/bin/node-canary -log=ERROR -log-without-color=true -mailserver $mailserver || failed_count=$((failed_count + 1))
    13  done <<< "$mailservers"
    14  
    15  if [ $failed_count -gt 0 ]; then
    16    echo "${failed_count}/${count} mailservers failed the test"
    17    exit 1
    18  else
    19    echo "All mailservers replied correctly"
    20  fi