laconic-network-bootstrap/scripts/delete-network-dirs.sh
2024-07-08 06:22:16 -06:00

27 lines
601 B
Bash
Executable File

#!/usr/bin/env bash
set -e
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
fi
if [[ -n "$1" ]]; then
machine_name_prefix=$1
else
echo "Usage: $0 <machine-name-prefix>"
exit 1
fi
machine_domain=borgboxes.network
node_count=4
node_network_dir=testnet-dir
local_gentx_dir=gentx-${machine_name_prefix}
echo "Deleting network dirs on all nodes"
for (( i=1 ; i<=$node_count ; i++ ));
do
node_name=${machine_name_prefix}-${i}.${machine_domain}
echo "Deleting ${node_network_dir} on ${node_name}"
ssh laconic@${node_name} rm -rf ${node_network_dir} ${local_gentx_dir}
done