provisioning tool for building opinionated architecture
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

22 lines
519 B

#!/bin/bash
function check_db_maria_exists() {
db-maria list | grep -q "$1"
}
function check_db_postgres_exists() {
db-psql list | grep -q "$1"
}
function extract_domain_from_fqdn() {
fqdn=$1
part1=$(builtin echo "$fqdn" | rev | cut -d'.' -f1 | rev)
part2=$(builtin echo "${fqdn%."$part1"}" | rev | cut -d'.' -f1 | rev)
builtin echo "$part2.$part1"
}
function extract_subdomain_from_fqdn() {
fqdn=$1
domain=$(extract_domain_from_fqdn "$fqdn")
builtin echo "${fqdn%."$domain"}"
}