This commit is contained in:
Nicole Rappe 2023-09-22 02:58:15 -06:00
parent a5c5200549
commit c0408c6560

View File

@ -15,11 +15,11 @@ while true; do
# Clone the repo if it doesn't exist # Clone the repo if it doesn't exist
if [ ! -d "repo" ]; then if [ ! -d "repo" ]; then
curl -d "Repository $REPO_URL doesn't exist locally - Downloading..." $NTFY_URL
echo "Repository $REPO_URL doesn't exist locally - Downloading..." echo "Repository $REPO_URL doesn't exist locally - Downloading..."
git clone $REPO_URL repo git clone $REPO_URL repo
cd repo cd repo
rsync -av --delete --exclude '.git/' ./ /DATA rsync -av --delete --exclude '.git/' ./ /DATA
curl -d "Repository $REPO_URL doesn't exist locally - Downloading..." $NTFY_URL
fi fi
# Fetch the latest changes # Fetch the latest changes
@ -33,10 +33,10 @@ while true; do
if [ $LOCAL = $REMOTE ]; then if [ $LOCAL = $REMOTE ]; then
echo "Repository Up-to-date" echo "Repository Up-to-date"
else else
curl -d "$REPO_URL Automatically Pulled Update" $NTFY_URL
echo "Pulling Updates from Repository..." echo "Pulling Updates from Repository..."
git pull origin main git pull origin main
rsync -av --delete --exclude '.git/' ./ /DATA rsync -av --delete --exclude '.git/' ./ /DATA
curl -d "$REPO_URL Automatically Pulled Update" $NTFY_URL
fi fi
# Wait for 5 seconds before the next iteration # Wait for 5 seconds before the next iteration