Files
fdroid-frajul/hosting/update.sh
T
2026-02-12 05:50:36 +01:00

26 lines
537 B
Bash

#! /bin/bash
if [ ! -d "/repo/.git" ]; then
echo "Cloning repository..."
git clone --branch "$BRANCH" "$REPO_URL" "/repo"
fi
while true; do
echo "Running repo update..."
cd "/repo" || exit
git fetch origin
LOCAL=$(git rev-parse HEAD)
REMOTE=$(git rev-parse origin/binaries)
if [ "$LOCAL" != "$REMOTE" ]; then
echo "Updating repo..."
git reset --hard origin/binaries
echo "Update complete."
else
echo "Nothing to do."
fi
sleep 600 # check every 10 min
done