#!/bin/bash # reset shell colors tput init # https://stackoverflow.com/questions/59895/how-to-get-the-source-directory-of-a-bash-script-from-within-the-script-itself SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink PROJECT_ROOT="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" SOURCE="$(readlink "$SOURCE")" [[ $SOURCE != /* ]] && SOURCE="$PROJECT_ROOT/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done PROJECT_ROOT="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" # required imports source "${PROJECT_ROOT}"/variables/manifest.sh source "${PROJECT_ROOT}"/utils/manifest.sh source "${PROJECT_ROOT}"/lib/manifest.sh # user configs file if [[ ! -e "${PROJECT_ROOT}"/config ]]; then cat << EOF > "${PROJECT_ROOT}"/config deploy_password=${deploy_password} mysql_root_password=${mysql_root_password} db_pass=${db_pass} EOF fi # this file has passwords sudo su - root <