domains.sh 1.28 KB
Newer Older
1 2 3 4
#!/usr/bin/env bash

declare -A DOMAINS

5
MAIN=("dbogatov.org" "dmytro.app" "bogatov.app" "bogatov.dev")
6

Dmytro Bogatov's avatar
Dmytro Bogatov committed
7 8 9 10 11
# boolean value indicates if non-wildcard cert should be requested

DOMAINS["__MAIN__"]=true
DOMAINS["cluster.__MAIN__"]=false
DOMAINS["pages.__MAIN__"]=false
Dmytro Bogatov's avatar
Dmytro Bogatov committed
12
DOMAINS["review.__MAIN__"]=false
Dmytro Bogatov's avatar
Dmytro Bogatov committed
13 14 15

DOMAINS["netwatch.app"]=true
DOMAINS["orlova.app"]=true
16 17 18 19 20 21 22 23 24
DOMAINS["bogatov.kiev.ua"]=true
DOMAINS["visasupport.com.ua"]=true
DOMAINS["visasupport.kiev.ua"]=true
DOMAINS["darinagulley.com"]=true
DOMAINS["moon-travel.com.ua"]=true
DOMAINS["nigmatullina.org"]=true
DOMAINS["photobarrat.com"]=true
DOMAINS["res-public.net"]=true
DOMAINS["shevastream.com"]=true
25
# DOMAINS["travelus.com.ua"]=true
26 27 28 29 30 31 32 33 34 35 36
DOMAINS["veles-russia.com"]=true
DOMAINS["visajapan.com.ua"]=true
DOMAINS["vleskniga.com"]=true
DOMAINS["votings.net"]=true

get-domains () {

	OUTPUT=""

	for domain in "${!DOMAINS[@]}" 
	do
Dmytro Bogatov's avatar
Dmytro Bogatov committed
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
		if [[ $domain = *"__MAIN__"* ]]
		then
			for main in ${MAIN[@]}
			do
				newdomain=${domain/__MAIN__/$main}
				if [ ${DOMAINS[${domain}]} == true ]
				then
					OUTPUT+="$newdomain,*.$newdomain,"
				else
					OUTPUT+="*.$newdomain,"
				fi
			done
		else
			if [ ${DOMAINS[${domain}]} == true ]
			then
				OUTPUT+="$domain,*.$domain,"
			else
				OUTPUT+="*.$domain,"
			fi
		fi
57 58 59 60 61 62
	done

	echo ${OUTPUT%?}
}

get-domains