3 RESOLVERS_LIST
=dnscrypt-resolvers.csv
4 ONLINE_RESOLVERS_LIST
=dnscrypt-online-resolvers.csv
5 DNSCRYPT_PROXY
=dnscrypt-proxy
7 CSV_FILE
="$(dirname $0)/${RESOLVERS_LIST}"
9 tmpfile
=$
(mktemp .
${ONLINE_RESOLVERS_LIST}.XXXXXXXXXXXX
) ||
exit 1
10 trap "rm -f ${tmpfile}" EXIT
12 if which csvlint
> /dev
/null
; then
13 csvlint
"$RESOLVERS_LIST" ||
echo "*** Invalid CSV file ***" >&2
16 exec < "$RESOLVERS_LIST"
20 echo "$header" |
egrep -q '^Name,' ||
echo "*** Invalid CSV file ***" >&2
25 resolver_name
=$
(echo "$line" | cut
-d, -f1)
26 eval "${DNSCRYPT_PROXY} -L ${CSV_FILE} -R ${resolver_name} -t ${MARGIN} -m 1"
29 echo "+ ${resolver_name} - OK" >&2
31 echo "- ${resolver_name} - Failed" >&2
35 mv -f "$tmpfile" "$ONLINE_RESOLVERS_LIST"