From 07c27cebf40b9cdebd7c5775022feb5ded1ab163 Mon Sep 17 00:00:00 2001 From: TheThomaas Date: Sun, 6 Sep 2026 07:25:37 +0000 Subject: [PATCH] Supprimer cookcli/rootfs/etc/s6-overlay/s6-rc.d/git-sync/run --- .../etc/s6-overlay/s6-rc.d/git-sync/run | 70 ------------------- 1 file changed, 70 deletions(-) delete mode 100644 cookcli/rootfs/etc/s6-overlay/s6-rc.d/git-sync/run diff --git a/cookcli/rootfs/etc/s6-overlay/s6-rc.d/git-sync/run b/cookcli/rootfs/etc/s6-overlay/s6-rc.d/git-sync/run deleted file mode 100644 index 3d10f6a..0000000 --- a/cookcli/rootfs/etc/s6-overlay/s6-rc.d/git-sync/run +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/with-contenv bashio -set -e - -# --- Fonction de synchronisation Git --- -sync_git() { - local REPO=$(bashio::config 'git_repository') - local BRANCH=$(bashio::config 'git_branch') - local USERNAME=$(bashio::config 'git_username') - local PASSWORD=$(bashio::config 'git_password') - local PATH=$(bashio::config 'recipes_path') - - if [ -z "$REPO" ]; then - bashio::log.info "Aucun dépôt Git configuré. Attente..." - sleep infinity - return - fi - - bashio::log.info "Synchronisation avec ${REPO} (branche: ${BRANCH})" - - # Construction de l'URL avec authentification si nécessaire - local AUTH_URL="$REPO" - if [ -n "$USERNAME" ] && [ -n "$PASSWORD" ]; then - # Supposons que l'URL est de type https://github.com/user/repo.git - local PROTOCOL="https://" - local REPO_WITHOUT_PROTOCOL="${REPO#https://}" - REPO_WITHOUT_PROTOCOL="${REPO_WITHOUT_PROTOCOL#http://}" - AUTH_URL="${PROTOCOL}${USERNAME}:${PASSWORD}@${REPO_WITHOUT_PROTOCOL}" - bashio::log.info "Authentification configurée pour ${USERNAME}" - fi - - # Clone ou pull - if [ ! -d "$PATH/.git" ]; then - bashio::log.info "Premier clone du dépôt..." - git clone --branch "$BRANCH" "$AUTH_URL" "$PATH" 2>&1 | bashio::log.info - else - bashio::log.info "Mise à jour du dépôt existant..." - cd "$PATH" - # Réinitialisation pour éviter les conflits - git fetch origin "$BRANCH" 2>&1 | bashio::log.info - git reset --hard "origin/$BRANCH" 2>&1 | bashio::log.info - cd - > /dev/null - fi - - bashio::log.info "Synchronisation Git terminée." -} - -# --- Fonction de synchronisation périodique --- -periodic_sync() { - local INTERVAL=$(bashio::config 'git_sync_interval') - if [ -z "$INTERVAL" ] || [ "$INTERVAL" -eq 0 ]; then - INTERVAL=3600 - fi - - bashio::log.info "Synchronisation périodique configurée toutes les ${INTERVAL}s" - - while true; do - sleep "$INTERVAL" - bashio::log.info "=== Synchronisation Git périodique ===" - sync_git - done -} - -# --- Exécution --- -bashio::log.info "=== Service de synchronisation Git ===" - -# Premier sync au démarrage -sync_git - -# Lancement du sync périodique en arrière-plan -periodic_sync & \ No newline at end of file