mirror of
https://github.com/lancachenet/monolithic
synced 2024-11-24 21:13:02 +00:00
Fixed offline startup
Aligned to lancache-dns
This commit is contained in:
parent
75f3bc45e4
commit
67e4bef59f
1 changed files with 11 additions and 2 deletions
|
@ -2,16 +2,25 @@
|
|||
|
||||
IFS=' '
|
||||
mkdir -p /data/cachedomains
|
||||
cd /data/cachedomains
|
||||
echo "Bootstrapping Monolithic from ${CACHE_DOMAINS_REPO}"
|
||||
|
||||
export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
|
||||
pushd /data/cachedomains > /dev/null
|
||||
if [[ ! -d .git ]]; then
|
||||
git clone ${CACHE_DOMAINS_REPO} .
|
||||
fi
|
||||
|
||||
if [[ "${NOFETCH:-false}" != "true" ]]; then
|
||||
git fetch origin
|
||||
# Disable error checking whilst we attempt to get latest
|
||||
set +e
|
||||
git remote set-url origin ${CACHE_DOMAINS_REPO}
|
||||
git fetch origin || echo "Failed to update from remote, using local copy of cache_domains"
|
||||
git reset --hard origin/${CACHE_DOMAINS_BRANCH}
|
||||
# Reenable error checking
|
||||
set -e
|
||||
fi
|
||||
popd > /dev/null
|
||||
|
||||
TEMP_PATH=$(mktemp -d)
|
||||
OUTPUTFILE=${TEMP_PATH}/outfile.conf
|
||||
echo "map \"\$http_user_agent£££\$http_host\" \$cacheidentifier {" >> $OUTPUTFILE
|
||||
|
|
Loading…
Reference in a new issue