deemix-docker/root/etc/cont-init.d/20-download

22 lines
708 B
Plaintext
Raw Normal View History

2020-06-05 19:25:27 +00:00
#!/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"
2020-07-24 17:32:41 +00:00
git clone --recurse-submodules https://codeberg.org/RemixDev/deemix-pyweb.git deemix
2020-06-05 19:25:27 +00:00
touch /deemix/updated
else
cd /deemix
localv=$(git rev-parse HEAD)
2020-07-24 17:32:41 +00:00
remotev=$(git ls-remote https://codeberg.org/RemixDev/deemix-pyweb.git refs/heads/master | cut -c1-40)
2020-06-05 19:25:27 +00:00
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