diff --git a/AutoInstall/autoinstall.ksh b/AutoInstall/autoinstall.ksh index eab2654..52ff825 100755 --- a/AutoInstall/autoinstall.ksh +++ b/AutoInstall/autoinstall.ksh @@ -1,5 +1,5 @@ #! /bin/bash -set -eou pipefail +set -eo pipefail #-------------------------------------------- # Script autoinstallation et configuration Ubuntu/Debian @@ -16,4 +16,39 @@ else echo "Erreur : Impossible de charger les sources ${fonctions_sources}" exit 1 } -fi \ No newline at end of file +fi + +# Recuperation de la distribution + +if command -v lsb_release >/dev/null 2>&1; then + systeme=$(lsb_release -d | cut -c 14-) +else + systeme="Inconnu (lsb_release non trouvé)" +fi + + +#Affichage du Menu +clear +echo -e "${SOULIGNE}===== MENU PRINCIPAL AUTOINSTALL =====${RESET} \n" +echo -e "Votre Systeme : ${BG_NOIR}${BLEU}${systeme}${RESET}" +echo "Que voulez vous faire ? " +echo " [1] - Mettre a jour les paquets" +echo " [2] - Mettre a jour les paquets et le systeme" +read reponse + +case ${reponse} in + + 1) + maj_depot + ;; + + 2) + maj_systeme + ;; + + #Autre + *) + echo -e "${ROUGE}merci de repondre${RESET}" + read reponse + ;; +esac diff --git a/AutoInstall/sources/fonctions.ksh b/AutoInstall/sources/fonctions.ksh index 1ed596f..15e4b94 100644 --- a/AutoInstall/sources/fonctions.ksh +++ b/AutoInstall/sources/fonctions.ksh @@ -1,6 +1,29 @@ #!/bin/bash set -eou pipefail +# Couleurs de texte (Foreground) +NOIR='\e[30m' +ROUGE='\e[31m' +VERT='\e[32m' +JAUNE='\e[33m' +BLEU='\e[34m' +VIOLET='\e[35m' +CYAN='\e[36m' +BLANC='\e[37m' + +# Couleurs de fond (Background) +BG_NOIR='\e[40m' +BG_ROUGE='\e[41m' +BG_VERT='\e[42m' +BG_JAUNE='\e[43m' + +# Styles +GRAS='\e[1m' +SOULIGNE='\e[4m' +RESET="\e[0m" + + +# -------------- FONCTIONS --------------- function maj_depot { #Actualisation depots @@ -104,9 +127,15 @@ function config_alias echo "alias maj='nala full-upgrade && flatpak upgrade && mainline install-latest && update-grub'" >> ~/.zshrc #Configuration des alias des commandes + + # commande ll pour lister les fichier echo "alias ll='lsd -ltr'" >> ~/.zshrc - echo "alias wget='http --download'" >> ~/.zshrc - echo "alias du='duf' " >> ~/.zshrc + + # commande dl pour download + echo "alias dl ='http --download'" >> ~/.zshrc + + # commande disque pour espace disque + echo "alias disque='duf' " >> ~/.zshrc } function config_zsh @@ -114,9 +143,3 @@ function config_zsh #Relancer la config de zsh p10k configure } - -function test_fonction -{ - clear - echo "TEST OK" -} \ No newline at end of file