borg-zenity/install.sh

72 lines
2.1 KiB
Bash
Raw Normal View History

2021-05-08 13:27:24 +02:00
#! /bin/bash
2022-05-26 10:10:44 +02:00
. testdistro.sh
# Borg zenity install and update
2022-05-26 10:10:44 +02:00
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
2022-05-26 10:10:44 +02:00
elif [[ "$OS" =~ "Manjaro" ]];then
echo "Manjaro detecté"
sudo pacman -Sy borgbackup zenity
fi
2022-05-26 10:10:44 +02:00
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
2022-04-15 10:20:13 +02:00
# Copie des fichiers
sudo mkdir -vp /opt/borg-zenity
sudo cp -fv icons/borg.svg /usr/share/icons/
sudo cp -fv icons/borgzenity-profils.svg /usr/share/icons/
sudo cp -fv icons/borgzenity-sauvegarde.svg /usr/share/icons/
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/
2022-05-26 10:10:44 +02:00
fi
2021-05-08 13:27:24 +02:00
2022-04-15 10:20:13 +02:00
# réglages des droits
2022-05-26 10:10:44 +02:00
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
2022-04-15 10:20:13 +02:00
sudo chmod a+rx /opt/borg-zenity/borg-gui.sh
sudo chmod a+rx /opt/borg-zenity/profile-manager.sh
2022-05-26 10:10:44 +02:00
fi
2022-04-15 10:20:13 +02:00
# Création du fichier de configuration de base
mkdir -vp $HOME/.config/borg/
if [ ! -f $HOME/.config/borg/borg-zenity.conf ];then
cp -fv borg-zenity.conf $HOME/.config/borg/
fi
2022-05-26 10:10:44 +02:00
# 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
echo "--------------------"
echo "Installation terminée."