ajout du code pour gérer Debian

This commit is contained in:
Djan GICQUEL 2022-05-26 10:10:44 +02:00
parent 575cd9eed2
commit eaa29a8426

View File

@ -1,16 +1,40 @@
#! /bin/bash
. testdistro.sh
# Borg zenity install and update
which zenity
if [ "$?" != "0" ]; then
bash testdistro.sh || exit
if [[ "$OS" =~ "Fedora" ]];then
echo "Fedora detecté"
sudo dnf install borgbackup zenity
elif [[ "$OS" =~ "Debian" ]];then
echo "Debian detecté"
su -c "apt-get -y install borgbackup zenity"
elif [[ "$OS" =~ "Ubuntu" ]];then
echo "Ubuntu detecté"
sudo apt-get install -y borgbackup zenity
elif [[ "$OS" =~ "Linux Mint" ]];then
echo "Linux Mint detecté"
sudo apt-get install -y borgbackup zenity
elif [[ "$OS" =~ "Manjaro" ]];then
echo "Manjaro detecté"
sudo pacman -Sy borgbackup zenity
fi
which borg
if [ "$?" != "0" ]; then
bash testdistro.sh || exit
fi
if [[ "$OS" =~ "Debian" ]];then
su -c "mkdir -vp /opt/borg-zenity"
su -c "cp -fv icons/borg.svg /usr/share/icons/"
su -c "cp -fv icons/borgzenity-profils.svg /usr/share/icons/"
su -c "cp -fv icons/borgzenity-sauvegarde.svg /usr/share/icons/"
su -c "cp -fv borg-zenity-sauvegarde.desktop /usr/share/applications/"
su -c "cp -fv borg-zenity-gestprofils.desktop /usr/share/applications/"
su -c "cp -fv borg-gui.sh /opt/borg-zenity/"
su -c "cp -fv profile-manager.sh /opt/borg-zenity/"
else
# Copie des fichiers
sudo mkdir -vp /opt/borg-zenity
sudo cp -fv icons/borg.svg /usr/share/icons/
@ -20,15 +44,23 @@ sudo cp -fv borg-zenity-sauvegarde.desktop /usr/share/applications/
sudo cp -fv borg-zenity-gestprofils.desktop /usr/share/applications/
sudo cp -fv borg-gui.sh /opt/borg-zenity/
sudo cp -fv profile-manager.sh /opt/borg-zenity/
fi
# réglages des droits
if [[ "$OS" =~ "Debian" ]];then
su -c "chmod a+rx /opt/borg-zenity/borg-gui.sh"
su -c "chmod a+rx /opt/borg-zenity/profile-manager.sh"
else
sudo chmod a+rx /opt/borg-zenity/borg-gui.sh
sudo chmod a+rx /opt/borg-zenity/profile-manager.sh
fi
# Création du fichier de configuration de base
mkdir -vp $HOME/.config/borg/
cp -fv borg-zenity.conf $HOME/.config/borg/
# nettoyage
if [ -f readme.md ];then cd ..;fi
if [ -f borg-zenity.zip ];then rm -v borg-zenity.zip;fi
if [ -d borg-zenity ];then rm -rv borg-zenity;fi