Bindlog/install_deps.sh

55 lines
1.2 KiB
Bash
Raw Normal View History

2024-08-26 23:05:03 +02:00
#!/bin/bash
# Fonction pour afficher un message d'erreur et quitter le script
function error_exit() {
echo "$1" >&2
exit 1
}
2024-08-26 23:08:52 +02:00
# Fonction pour Debian/Ubuntu
function install_debian() {
echo "Installation sur Debian/Ubuntu..."
apt-get update
apt-get install sudo bind apache2 -y
2024-08-26 23:05:03 +02:00
}
2024-08-26 23:08:52 +02:00
# Fonction pour Fedora/Oracle
function install_debian() {
echo "Installation sur Fedora/Oracle..."
echo "A venir"
2024-08-26 23:05:03 +02:00
}
2024-08-26 23:08:52 +02:00
2024-08-26 23:05:03 +02:00
# Détection du système d'exploitation
OS="$(uname -s)"
case "$OS" in
Linux)
DISTRO=$(lsb_release -i | awk '{print tolower($3)}')
case "$DISTRO" in
debian|ubuntu)
install_htop_debian
;;
fedora)
2024-08-26 23:08:52 +02:00
install_fedora
2024-08-26 23:05:03 +02:00
;;
arch)
2024-08-26 23:08:52 +02:00
install_arch
2024-08-26 23:05:03 +02:00
;;
*)
echo "Distribution non supportée : $DISTRO"
error_exit "Installation de htop non supportée pour cette distribution."
;;
esac
;;
MINGW*)
install_htop_mingw
;;
*)
error_exit "Système d'exploitation non supporté : $OS"
;;
esac
echo "Installation de htop terminée avec succès."