Files
cadmium/scripts/download

25 lines
458 B
Bash
Executable File

#!/bin/sh
if [ "x$1" = "x" ]; then
echo "Usage: $0 <Tarball URL>"
exit 1
fi
if [ -e "source" ]; then
echo "source/ directory already exists, remove it first"
exit 1
fi
curl -L "$1" | tar -xzf -
mv caddy* source
# Disable telemetry in run.go and rename to Cadmium
patch -d source -p1 <"$(pwd)/patches/run.go.diff"
# Replace telemetry with a stub
rm -r source/telemetry
mkdir source/telemetry
cp patches/collection.go source/telemetry/collection.go