#!/bin/sh set -e WORKPTH="/etc/debmirror/" REPO_DIR="$WORKPTH/Debain-repos" REPO_URL="https://$GITEA_TOKEN@tea.shupogaki.org/YuruC3/Debain-repos.git" # Clone repo only if it doesn't already exist if [ ! -d "$REPO_DIR/.git" ]; then echo "[$(date)] Cloning repository..." git clone "$REPO_URL" "$REPO_DIR" fi cd "$REPO_DIR" git config user.name "UpdateBot" git config user.email "UpdateBot@localhost.local" # pull changes git pull # check if modified if git diff --quiet && git diff --cached --quiet; then echo "No changes to commit." # if yes, push else git add MirrorsV4 MirrorsV6 git commit -m "Auto-update mirror list on $(date -Iseconds)" git push echo "Changes pushed successfully." fi