#!/bin/bash set -eu cd "$(dirname "$0")" if [ ! -f "$HOME/.aws/credentials" ]; then # TODO write a credential file baseline echo "ERROR: Please update your '$HOME/.aws/credentials' file before continuing." mkdir -p "$HOME/.aws" touch "$HOME/.aws/credentials" # stub out a site_definition with new passwords. cat >"$HOME/.aws/credentials" <> $REMOTE_HOME/.ssh/authorized_keys" # we have to ensure ubuntu is able to do sudo less docker commands. docker-machine ssh "$FQDN" sudo usermod -aG docker ubuntu # we restart so dockerd starts with fresh group membership. docker-machine ssh "$FQDN" sudo systemctl restart docker # TODO INSTALL DOCKER COMPOSE # let's wire up the DNS so subsequent ssh commands resolve to the VPS. ./run_ddns.sh # remove the SSH hostname from known_hosts as we'll # todo why do we need this again? ssh-keygen -f "$SSH_HOME/known_hosts" -R "$FQDN"