Files
iptv-manager-service/scripts/destroy.sh
Stefano 5698e7f26b
All checks were successful
AWS Deploy on Push / build (push) Successful in 4m14s
Moved ssh public key to an environment variable
2025-05-20 15:51:34 -05:00

18 lines
594 B
Bash
Executable File

#!/bin/bash
# Load environment variables from .env file if it exists
if [ -f ${PWD}/.env ]; then
# Use set -a to automatically export all variables
set -a
source ${PWD}/.env
set +a
fi
# Check if required environment variables are set
if [ -z "$FREEDNS_User" ] || [ -z "$FREEDNS_Password" ] || [ -z "$DOMAIN_NAME" ] || [ -z "$SSH_PUBLIC_KEY" ]; then
echo "Error: FREEDNS_User, FREEDNS_Password, DOMAIN_NAME, and SSH_PUBLIC_KEY must be set as environment variables or in a .env file."
exit 1
fi
# Destroy infrastructure
cdk destroy --app="python3 ${PWD}/app.py" --force