Removed errenous additional maps file in root

This commit is contained in:
VibroAxe 2018-12-01 10:53:01 +00:00
parent 0a980bd03c
commit 5403e5cd85

View file

@ -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