mirror of
https://gitlab.com/jarylc/docker-duoauthproxy.git
synced 2026-02-04 15:39:41 +00:00
29 lines
957 B
Bash
Executable File
29 lines
957 B
Bash
Executable File
#!/bin/bash
|
|
|
|
apk add curl jq
|
|
|
|
[[ ! -f EXISTING ]] || touch EXISTING
|
|
EXISTING=$(cat EXISTING)
|
|
echo "Existing: ${EXISTING}"
|
|
|
|
if [[ -n $OVERWRITE ]]; then
|
|
echo "Overwriting: $OVERWRITE"
|
|
LATEST=$OVERWRITE
|
|
else
|
|
INFO=$(curl https://duo.com/docs/checksums | grep 'https://dl.duosecurity.com/duoauthproxy' | grep 'src.tgz' | rev | cut -d'>' -f1 | rev)
|
|
CHECKSUM=$(echo "$INFO" | cut -d' ' -f1)
|
|
LATEST=$(echo "$INFO" | cut -d'-' -f2)
|
|
PYTHON_VERSION=$(curl https://duo.com/docs/authproxy-notes | grep -Eo 'Python to \d+\.\d+\.\d+' | head -n1 | rev | cut -d' ' -f1 | rev)
|
|
echo "Latest: ${LATEST}"
|
|
echo "Checksum: ${CHECKSUM}"
|
|
echo "Python Version: ${PYTHON_VERSION}"
|
|
fi
|
|
|
|
if [[ (-n "${LATEST}" && "${LATEST}" != "${EXISTING}") ]]; then
|
|
mv build.template.yml build.yml
|
|
sed -i "s \$CHECKSUM ${CHECKSUM} g" 'build.yml'
|
|
sed -i "s \$LATEST ${LATEST} g" 'build.yml'
|
|
sed -i "s \$PYTHON_VERSION ${PYTHON_VERSION} g" 'build.yml'
|
|
echo "Building..."
|
|
fi
|