deemix-docker/root/etc/cont-init.d/20-download
Henning Bocklage 440d8319bf initial commit
2020-06-05 21:25:27 +02:00

22 lines
706 B
Plaintext

#!/usr/bin/with-contenv bash
# download and unpack
echo "[cont-init.d] Downloading and unpacking"
if [ ! -f "/deemix/server.py" ]; then
echo "[cont-init.d] First start, cloning repo"
git clone --recurse-submodules https://notabug.org/RemixDev/deemix-pyweb.git deemix
touch /deemix/updated
else
cd /deemix
localv=$(git rev-parse HEAD)
remotev=$(git ls-remote https://notabug.org/RemixDev/deemix-pyweb.git refs/heads/master | cut -c1-40)
if [ $localv = $remotev ]; then
echo -e "[cont-init.d] Latest Version. No update needed"
else
echo -e "[cont-init.d] Newer Version. Updating"
git pull --recurse-submodules
touch /deemix/updated
fi
fi