2023-02-01 14:44:05 -05:00

28 lines
855 B
Executable File

set -eu
cd "$(dirname "$0")"
if ! lxc remote get-default | grep -q local; then
lxc remote switch local
# if the mgmt machine doesn't exist, then warn the user to perform ./
if ! lxc list --format csv | grep -q "ss-mgmt"; then
echo "ERROR: the management machine VM does not exist. You probably need to run './'."
echo "INFO: check out for more information."
# if the machine does exist, let's make sure it's RUNNING.
if lxc list --format csv | grep -q "ss-mgmt,STOPPED"; then
echo "INFO: The management machine was in a STOPPED state. Starting the environment. Please wait."
lxc start ss-mgmt
sleep 30
. ./management/
wait-for-it -t 300 "$IP_V4_ADDRESS:22" > /dev/null 2>&1
ssh ubuntu@"$IP_V4_ADDRESS"