#!/bin/bash #trigg.sh GENTOO TERMINAL MANAGER #Ringraziamenti a linuxminditalia sabayonino fedeliallalinea nessuno e nick-carter #EDITOR=leafpad #data 18/07/2018 RED='\033[0;41;30m' STD='\033[0;0;39m' GREEN='\033[1;32;3m' # ---------------------------------- PRIVILEGI-ROOT if [ "$EUID" -ne 0 ] then echo "Eseguire lo script con i permessi di amministratore (su o sudo)" exit fi # ---------------------------------- CERCA cerca(){ while true do clear echo " "; echo " 1) Aggiorna eix e cerca _/_/_/ _/ "; echo " 2) Cerca _/ _/_/ _/_/_/ _/_/_/_/ _/_/ _/_/ "; echo " _/ _/_/ _/_/_/_/ _/ _/ _/ _/ _/ _/ _/ "; echo " 9) Menu _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ "; echo " _/_/_/ _/_/_/ _/ _/ _/_/ _/_/ _/_/ "; echo " "; echo " "; echo "scegli la tua opzione" read -s -n1 if [ "$REPLY" == "1" ] then echo "quale pacchetto vuoi cercare ?" read pack eix-update eix $pack echo " premi un tasto per continuare" read -n1 else if [ "$REPLY" == "2" ] then echo "quale pacchetto vuoi cercare ?" read pack eix $pack echo " premi un tasto per continuare" read -n1 else if [ "$REPLY" == "9" ] then break fi fi fi done } # ---------------------------------- APPLICAZIONI app(){ while true do clear echo " 1) Installa da Portage Tree "; echo " 2) Installa da Overlays _/_/_/ _/ "; echo " 3) Disinstalla _/ _/_/ _/_/_/ _/_/_/_/ _/_/ _/_/ "; echo " _/ _/_/ _/_/_/_/ _/ _/ _/ _/ _/ _/ _/ "; echo " 9) Menu _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ "; echo " _/_/_/ _/_/_/ _/ _/ _/_/ _/_/ _/_/ "; echo " "; echo " "; echo "scegli la tua opzione" read -s -n1 if [ "$REPLY" == "1" ] then echo -n "pacchetto da installare " ; read INSTALLA emerge --ask $INSTALLA echo "eseguito" echo " premi un tasto per continuare" read -n1 else if [ "$REPLY" == "2" ] then echo "devi prima scaricare l'ebuild" echo "premi un tasto per continuare" read -n1 cd ~/Scaricati/ echo -n "Indica Categoria/Pacchetto dell'appilcazione da installare" ; read rp ls echo -n "Inserisci .ebuild " ; read ebuild mkdir -p /usr/local/portage/$rp cp $ebuild /usr/local/portage/$rp #mv $ebuild /mnt/DATI/gentoo/'installazione gentoo'/ebuild/ cd /usr/local/portage/$rp repoman manifest emerge --ask $rp echo " premi un tasto per continuare" read -n1 else if [ "$REPLY" == "3" ] then echo -n "Indica categoria/pacchetto da rimuovere" ; read ctpr emerge --depclean --ask $ctpr echo "eseguito" echo " premi un tasto per continuare" read -n1 else if [ "$REPLY" == "9" ] then break fi fi fi fi done } # ---------------------------------- USE-FLAG uf(){ while true do clear echo " "; echo " 1) Abilita Use-Flag _/_/_/ _/ "; echo " 2) Disabilita Use-Flag _/ _/_/ _/_/_/ _/_/_/_/ _/_/ _/_/ "; echo " _/ _/_/ _/_/_/_/ _/ _/ _/ _/ _/ _/ _/ "; echo " 9) Menu _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ "; echo " _/_/_/ _/_/_/ _/ _/ _/_/ _/_/ _/_/ "; echo " "; echo "scegli la tua opzione" read -s -n1 if [ "$REPLY" == "1" ] then echo -n "Indica Categoria/Pacchetto da ricompilare" ; read cpt echo -n "Indica Use-flag da abilitare" ; read use euse --enable $use --package $cpt emerge --ask --changed-use --deep @world echo "eseguito" echo " premi un tasto per continuare" read -n1 else if [ "$REPLY" == "2" ] then echo -n "Indica Categoria/Pacchetto da ricompliare" ; read dcpt echo -n "Indica Use-flag da disabilitare" ; read duse euse --disable $duse --package $dcpt emerge --ask --changed-use --deep @world echo "eseguito" echo " premi un tasto per continuare" read -n1 else if [ "$REPLY" == "9" ] then break fi fi fi done } # ---------------------------------- AGGIORNA-SISTEMA as(){ while true do clear echo " 1) Aggiorna Portage Tree "; echo " 2) Aggiorna Pacchetti e Dipendenze _/_/_/ _/ "; echo " 3) emerge --update --newuse --deep @world _/ _/_/ _/_/_/ _/_/_/_/ _/_/ _/_/ "; echo " 4) emerge --ask --depclean _/ _/_/ _/_/_/_/ _/ _/ _/ _/ _/ _/ _/ "; echo " 5) emerge @preserved-rebuild _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ "; echo " _/_/_/ _/_/_/ _/ _/ _/_/ _/_/ _/_/ "; echo " 9) Menu "; echo "scegli la tua opzione" read -s -n1 if [ "$REPLY" == "1" ] then emerge --sync echo "eseguito" echo " premi un tasto per continuare" read -n1 else if [ "$REPLY" == "2" ] then echo "Stai per lanciare emerge --update --changed-use --deep --with-bdeps=y @world" echo "Premi un Tasto per Continuare " read -n1 emerge --update --changed-use --deep --with-bdeps=y @world echo "eseguito" echo " premi un tasto per continuare" read -n1 else if [ "$REPLY" == "3" ] then emerge --update --newuse --deep @world echo "eseguito" echo " premi un tasto per continuare" read -n1 else if [ "$REPLY" == "4" ] then emerge --ask --depclean echo "eseguito" echo " premi un tasto per continuare" read -n1 else if [ "$REPLY" == "5" ] then emerge @preserved-rebuild echo "eseguito" echo " premi un tasto per continuare" read -n1 else if [ "$REPLY" == "9" ] then break fi fi fi fi fi fi done } # ---------------------------------- PULIZIA-SISTEMA ps(){ while true do clear echo " 1) Pulizia /var/tmp/portage "; echo " 2) Esegui eclean-dist _/_/_/ _/ "; echo " _/ _/_/ _/_/_/ _/_/_/_/ _/_/ _/_/ "; echo " _/ _/_/ _/_/_/_/ _/ _/ _/ _/ _/ _/ _/ "; echo " 9) Menu _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ "; echo " _/_/_/ _/_/_/ _/ _/ _/_/ _/_/ _/_/ "; echo " "; echo " "; echo "scegli la tua opzione" read -s -n1 if [ "$REPLY" == "1" ] then echo "stai per eliminare le cartelle in /var/tmp/portage/ " echo " premi un tasto per continuare" read -n1 /usr/bin/find /var/tmp/portage/ -mindepth 1 -maxdepth 1 -exec /bin/rm -rf {} +; echo "eseguito" echo " premi un tasto per continuare" read -n1 else if [ "$REPLY" == "2" ] then echo "stai per eseguire eclean-dist" echo "premi un tasto per continuare" read -n1 eclean-dist echo "eseguito" echo " premi un tasto per continuare" read -n1 else if [ "$REPLY" == "9" ] then break fi fi fi done } # ---------------------------------- NEWS news(){ while true do clear echo " 1) Leggi Vecchie News "; echo " 2) Leggi Nuove News _/_/_/ _/ "; echo " 3) Lista delle News _/ _/_/ _/_/_/ _/_/_/_/ _/_/ _/_/ "; echo " 4) Cancella News _/ _/_/ _/_/_/_/ _/ _/ _/ _/ _/ _/ _/ "; echo " _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ "; echo " _/_/_/ _/_/_/ _/ _/ _/_/ _/_/ _/_/ "; echo " 9) Menu "; echo " "; echo "scegli la tua opzione" read -s -n1 if [ "$REPLY" == "1" ] then eselect news read echo " premi un tasto per continuare" read -n1 else if [ "$REPLY" == "2" ] then eselect news read new echo " premi un tasto per continuare" read -n1 else if [ "$REPLY" == "3" ] then eselect news list echo " premi un tasto per continuare" read -n1 else if [ "$REPLY" == "4" ] then eselect news purge echo " premi un tasto per continuare" read -n1 else if [ "$REPLY" == "9" ] then break fi fi fi fi fi done } # ---------------------------------- ESCI esci(){ clear echo echo " Grazie per aver usato il mio script " echo exit } # ---------------------------------- MENU menu() { clear echo -e "${GREEN} ╔═════════════════════════════════════════╗ " echo -e "${GREEN} ║ ╔══TRIGG.sh GENTOO TERMINAL MANAGER═══╗ ║ " echo -e "${GREEN} ║ ║ [1] Cerca App ║ ║ " echo -e "${GREEN} ║ ║ [2] Installa Rimuovi App ║ ║ " echo -e "${GREEN} ║ ║ [3] Gestione Use-Flag ║ ║ " echo -e "${GREEN} ║ ║ [4] Aggiorna Sistema ║ ║ " echo -e "${GREEN} ║ ║ [5] Pulizia Sistema ║ ║ " echo -e "${GREEN} ║ ║ [6] Le tue News ║ ║ " echo -e "${GREEN} ║ ║ [0] Esci ║ ║ " echo -e "${GREEN} ║ ║ ╚═══════════════════════════════════╝ ║ " echo -e "${GREEN} ║ ╚═══════════════════════════════════════╝ " } # ---------------------------------- OPZIONI opzioni(){ local choice read -p "Scegli la tua operazione [0 - 6]" choice case $choice in 1) cerca ;; 2) app ;; 3) uf ;; 4) as ;; 5) ps ;; 6) news ;; 0) esci ;; *) echo -e "${RED}Scelta non valida...${STD}" && sleep 2 ;; esac } ######### script0 ################ while true do menu opzioni done