From cd6cb9296afe0998c85f8a9d3517a726691cd0d0 Mon Sep 17 00:00:00 2001 From: TyleoDvDelaware3217 Date: Wed, 25 Jun 2025 14:26:01 +0200 Subject: [PATCH] Actualiser Inject-USR-Repo.bash --- Inject-USR-Repo.bash | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/Inject-USR-Repo.bash b/Inject-USR-Repo.bash index 092d09d..db76649 100644 --- a/Inject-USR-Repo.bash +++ b/Inject-USR-Repo.bash @@ -1,6 +1,45 @@ #!/usr/bin/env bash - +# =========================== Repo=$1 Reponame="USR-$Repo" +Repolink="https://git.tyleo.dev/TyleoDvDelaware3217/USR-$Repo" +# =========================== +# Dossier à vérifier +USRDIR="/usr/local/bin" -echo $Reponame +# Vérifie si le dossier contient des fichiers +if [ "$(ls -A "$DOSSIER")" ]; then + echo "/usr/local/bin is populated ! Cancelled." + exit 1 +else + echo "/usr/local/bin is empty." +fi + +# ========= DEPLOY ========= +## INSTALL GIT +echo "Détection du système..." + + if command -v rpm-ostree &> /dev/null; then + echo "Système basé sur RPM-OSTree détecté" + rpm-ostree install git + echo "Redémarrage nécessaire pour finaliser l'installation sur RPM-OSTree" + elif [ -f /etc/debian_version ]; then + echo "Debian/Ubuntu détecté" + sudo apt update + sudo apt install -y git + elif [ -f /etc/fedora-release ]; then + echo "Fedora détecté" + sudo dnf install -y git + elif [ -f /etc/arch-release ]; then + echo "Arch Linux détecté" + sudo pacman -Sy --noconfirm git + else + echo "Distribution non prise en charge" + exit 1 + fi + +## INJECT REPO +git clone $Repolink /usr/local/bin +chmod -v +x /usr/local/bin/* +ls /usr/local/bin +# ========================== \ No newline at end of file