#!/bin/bash

## Copyright (C) 2020 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

while read -r -d $'\n' line ; do
   read -r first_word second_word _ <<< "$line"
   temp="$first_word"
   temp="$(echo "$temp" | str_replace "http://" "")"
   plain_url="$(echo "$temp" | str_replace "https://" "")"
   ## web.archive.org did not support tlsv1.3 at time of writing.
   if scurl --tlsv1.2 --silent --location "$second_word" | grep -q "$plain_url" ; then
      continue
   fi
   echo "Failed!"
   echo scurl --tlsv1.2 --silent --location "$second_word"
   echo "plain_url: $plain_url"
   echo "second_word: $second_word"
   echo ""
done < <( /usr/share/sdwdate/onion-list-all )
