....
This commit is contained in:
@@ -89,13 +89,15 @@ jobs:
|
|||||||
echo "Grabbing subdomains from docker-compose.yml..."
|
echo "Grabbing subdomains from docker-compose.yml..."
|
||||||
yq '.services[].labels.swag_url' docker-compose.yml | egrep -v 'null' | sed -e 's|"||g' | awk -F'.' '{print $1}' | sort > compose_subdomains.txt
|
yq '.services[].labels.swag_url' docker-compose.yml | egrep -v 'null' | sed -e 's|"||g' | awk -F'.' '{print $1}' | sort > compose_subdomains.txt
|
||||||
sdiff -l -s compose_subdomains.txt cloudflare_subdomains.txt | awk '{print $1}' | egrep '^[a-z]' > missing_subdomains.txt
|
sdiff -l -s compose_subdomains.txt cloudflare_subdomains.txt | awk '{print $1}' | egrep '^[a-z]' > missing_subdomains.txt
|
||||||
|
cat missing_subdomains.txt
|
||||||
if [ -s missing_subdomains.txt ]; then
|
if [ -s missing_subdomains.txt ]; then
|
||||||
for subdomain in $(cat missing_subdomains.txt); do
|
echo "Missing subdomains found. Creating them..."
|
||||||
echo "Adding ${subdomain} to Cloudflare..."
|
while IFS= read -r subdomain; do
|
||||||
flarectl dns create --zone ${{ secrets.CF_ZONE_ID }} --type CNAME --name "${subdomain}" --content "trez.wtf" --proxy true
|
echo "Creating $subdomain.trez.wtf..."
|
||||||
done
|
flarectl dns create --zone "trez.wtf" --name "$subdomain" --type CNAME --content "trez.wtf"
|
||||||
|
done < missing_subdomains.txt
|
||||||
else
|
else
|
||||||
echo "No missing subdomains found."
|
echo "No missing subdomains found."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
merge-pr:
|
merge-pr:
|
||||||
|
|||||||
Reference in New Issue
Block a user