#!/bin/bash

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

set -x
set -e
true "INFO: Currently running script: $BASH_SOURCE $@"

dist_build_internal_run="true"

MYDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$MYDIR"

## XXX: hardcoded path
source "$HOME/derivative-maker/help-steps/pre"
source "$HOME/derivative-maker/help-steps/colors"
source "$HOME/derivative-maker/help-steps/variables"

trap "exithandler" EXIT

true "${cyan}INFO: rsync test...${reset}"

rsync-ssl --dry-run --recursive --times --quiet rsync://kicksecure.com/kicksecure
rsync-ssl --dry-run --recursive --times --quiet rsync://whonix.org/whonix
## Cannot use subdomain.
#rsync --dry-run --recursive --times --quiet rsync://rsync.whonix.org/whonix

## XXX: hardcoded
onion="w5j6stm77zs6652pgsij4awcjeel3eco7kvipheu6mtr623eyyehj4yd.onion"
torsocks rsync --dry-run --recursive --times --quiet "rsync://${onion}/kicksecure"
onion="dds6qkxpwdeubwucdiaord2xgbbeyds25rbsgr73tbfpqpt4a6vjwsyd.onion"
torsocks rsync --dry-run --recursive --times --quiet "rsync://${onion}/whonix"

true "${cyan}INFO: Done with rsync test.${reset}"
