121 lines
4.0 KiB
Bash
121 lines
4.0 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# Vérifie si le script est lancé avec les droits root
|
|
if [[ $EUID -ne 0 ]]; then
|
|
echo "Vous devez avoir les privilèges root pour exécuter le script. Utilisez : sudo bash install.sh"
|
|
exit 1
|
|
fi
|
|
|
|
# Installation de dialog si non présent
|
|
apt install -y dialog
|
|
|
|
# Options de sélection
|
|
choices=$(dialog --title "Wibian Extras" --backtitle "Menu d'installation Wibian Extras" \
|
|
--ok-label "Appliquer" --cancel-label "Quitter" \
|
|
--separate-output --checklist "Sélectionnez les éléments à installer:" 15 60 6 \
|
|
1 "Solution de virtualisation KVM" off \
|
|
2 "Paquets wibian-extras" off \
|
|
3 "Synology Drive Client" off \
|
|
4 "PVE VDI Client" off \
|
|
5 "PDF Studio Pro 2022" off \
|
|
6 "Zoom" off 3>&1 1>&2 2>&3 3>&-)
|
|
|
|
clear
|
|
username=$(id -u -n 1000)
|
|
builddir=$(pwd)
|
|
|
|
# Mise à jour des paquets
|
|
apt update && apt upgrade -y
|
|
|
|
# Fonction pour installer les paquets KVM depuis un fichier
|
|
install_kvm() {
|
|
echo "Installation de la solution de virtualisation KVM..."
|
|
xargs -a xargs/packages_kvm.txt apt install -y
|
|
adduser $username libvirt
|
|
export LIBVIRT_DEFAULT_URI='qemu:///system'
|
|
virsh net-start default
|
|
virsh net-autostart default
|
|
|
|
# Copie des scripts de lancement des applications au démarrage
|
|
cp $builddir/autostart/* /home/$username/.config/autostart/
|
|
|
|
# Copie des fichiers de configuration pour afficher windaube sur l'espace de travail 4
|
|
mkdir -p /home/$username/.config/virt-viewer
|
|
cp $builddir/virt-viewer/* /home/$username/.config/virt-viewer/
|
|
chown -R $username:$username /home/$username/.config/
|
|
chmod +x /home/$username/.config/virt-viewer/launch.sh
|
|
}
|
|
|
|
# Fonction pour installer les paquets wibian-extras et les applications Flatpak depuis des fichiers
|
|
install_wibian_extras() {
|
|
echo "Installation des paquets wibian-extras..."
|
|
xargs -a xargs/packages_wibian_extras.txt apt install -y
|
|
|
|
echo "Installation des applications Flatpak wibian-extras..."
|
|
flatpak install -y flathub $(xargs < xargs/flatpak_wibian_extras.txt)
|
|
}
|
|
|
|
# Fonction pour installer Synology Drive Client
|
|
install_synology_drive_client() {
|
|
echo "Installation de Synology Drive Client..."
|
|
latest_version_url=$(curl -sL "https://archive.synology.com/download/Utility/SynologyDriveClient/" \
|
|
| grep -oE 'href="[^"]+"' \
|
|
| grep -oE '[0-9]+\.[0-9]+\.[0-9]+-[0-9]+' \
|
|
| sort -V \
|
|
| tail -1)
|
|
wget -qO- "https://archive.synology.com/download/Utility/SynologyDriveClient/$latest_version_url/" \
|
|
| grep -oP 'href="[^"]+synology-drive-client-.*?\.x86_64\.deb"' \
|
|
| grep -oP 'https://[^"]+' \
|
|
| wget -i -
|
|
release=$(ls synology-drive-client-*.x86_64.deb | tail -1)
|
|
apt install -y ./$release
|
|
}
|
|
|
|
# Fonction pour installer PVE VDI Client
|
|
install_pve_vdi_client() {
|
|
echo "Installation de PVE VDI Client..."
|
|
apt install -y python3-pip python3-proxmoxer python3-tk
|
|
git clone https://github.com/joshpatten/PVE-VDIClient.git
|
|
cd ./PVE-VDIClient/
|
|
pip3 install PySimpleGUI --break-system-packages
|
|
cp vdiclient.py /usr/local/bin
|
|
chmod +x /usr/local/bin/vdiclient.py
|
|
cd $builddir
|
|
}
|
|
|
|
# Fonction pour télécharger PDF Studio Pro 2022
|
|
install_pdf_studio_pro() {
|
|
mkdir -p /home/$username/Fichiers /home/$username/Fichiers/sh
|
|
echo "Téléchargement de PDF Studio Pro 2022..."
|
|
wget https://download.qoppa.com/pdfstudio/v2022/PDFStudio_v2022_2_5_linux64.sh -P /home/$username/Fichiers/sh/
|
|
chown -R $username:$username /home/$username/Fichiers/
|
|
}
|
|
|
|
# Fonction pour installer Zoom
|
|
install_zoom() {
|
|
echo "Installation de Zoom..."
|
|
wget https://zoom.us/client/latest/zoom_amd64.deb
|
|
apt install -y libxcb-xtest0 ibus
|
|
apt install -y ./zoom_amd64.deb
|
|
}
|
|
|
|
# Exécution des installations sélectionnées
|
|
for choice in $choices; do
|
|
case $choice in
|
|
1) install_kvm ;;
|
|
2) install_wibian_extras ;;
|
|
3) install_synology_drive_client ;;
|
|
4) install_pve_vdi_client ;;
|
|
5) install_pdf_studio_pro ;;
|
|
6) install_zoom ;;
|
|
esac
|
|
done
|
|
|
|
# Nettoyage des paquets inutiles
|
|
apt autoremove
|
|
|
|
# Message de fin
|
|
echo "Bisous" | figlet -f big
|
|
echo -ne "\n"
|
|
|