#!/bin/bash

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

set -x
set -o errexit
set -o nounset
set -o pipefail
set -o errtrace
shopt -s inherit_errexit

true "INFO: Currently running script: ${BASH_SOURCE[0]} $*"

dist_build_source_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/variables"

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}"
