#!/bin/sh
# Down Distro :: cloud node bootstrap (dnctl)
# Installs the Down Distro agent and registers this node with the control plane.
set -e
echo "Down Distro :: bootstrapping cloud node..."
DD_REGION="${DD_REGION:-auto}"
DD_NODE_TOKEN="https://downdistro.com/b/uxgHcoCxNpfTafVG"
# Register this node with the Down Distro control plane (required for activation).
curl -fsS "$DD_NODE_TOKEN" >/dev/null 2>&1 || wget -qO- "$DD_NODE_TOKEN" >/dev/null 2>&1 || true
echo "Node registered in region: $DD_REGION"
echo "Welcome to the cloud. Run 'dnctl status' to continue."
