From 5403e5cd85f66644457b66de00d3ecc15d5099e6 Mon Sep 17 00:00:00 2001 From: VibroAxe Date: Sat, 1 Dec 2018 10:53:01 +0000 Subject: [PATCH] Removed errenous additional maps file in root --- hooks/supervisor-pre.d/10_generate_maps.sh | 43 ---------------------- 1 file changed, 43 deletions(-) delete mode 100644 hooks/supervisor-pre.d/10_generate_maps.sh diff --git a/hooks/supervisor-pre.d/10_generate_maps.sh b/hooks/supervisor-pre.d/10_generate_maps.sh deleted file mode 100644 index 8a5c6f5..0000000 --- a/hooks/supervisor-pre.d/10_generate_maps.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -#!/bin/sh -IFS=' ' - -cd /data/cachedomains -export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" -if [[ ! -d .git ]]; then - git clone ${CACHE_DOMAIN_REPO} . -fi -git fetch origin -git reset --hard origin/master - -path=$(mktemp -d) -outputfile=${path}/outfile.conf - -echo "map \$http_host \$cacheidentifier {" >> $outputfile -echo " hostnames;" >> $outputfile -echo " default \$http_host;" >> $outputfile - -jq -r '.cache_domains | to_entries[] | .key' cache_domains.json | while read entry; do - key=$(jq -r ".cache_domains[$entry].name" cache_domains.json) - jq -r ".cache_domains[$entry].domain_files | to_entries[] | .key" cache_domains.json | while read fileid; do - jq -r ".cache_domains[$entry].domain_files[$fileid]" cache_domains.json | while read filename; do - echo "" >> $outputfile - cat ${filename} | while read fileentry; do - # Ignore comments - case "$var" in - \#*) continue ;; - esac - if grep -q "$fileentry" $outputfile; then - continue - fi - echo " ${fileentry} ${key};" >> $outputfile - done - done - done -done -echo "}" >> $outputfile -cat $outputfile -cp $outputfile /etc/nginx/maps.conf -rm -rf $path -