From 547d35464aa4b71c80bc5417be4fe54c8307f4c7 Mon Sep 17 00:00:00 2001 From: Bruno Fontes Date: Thu, 9 Aug 2018 00:34:40 -0300 Subject: [PATCH] Including colors, using functions and fixing sudo pass on update --- Pacman/updateRepositories.sh | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/Pacman/updateRepositories.sh b/Pacman/updateRepositories.sh index fc00328..2d518dc 100755 --- a/Pacman/updateRepositories.sh +++ b/Pacman/updateRepositories.sh @@ -5,27 +5,24 @@ function bold() { echo -e "${BOLD}$1${NC}" } +function s() { + echo -e "$sudoPass\n" | sudo -S $1 + echo +} + echo -n Please type your sudo password: read -s sudoPass -echo -echo +echo; echo bold "Pacman-mirrors -g" +s "pacman-mirrors -g" echo -echo "$sudoPass\n" | sudo -nS pacman-mirrors -g -echo -echo -bold "Updating with Pacman..." -echo -echo "$sudoPass\n" | sudo -nS pacman -Syu --color always -echo -echo -bold "Updating with aurman..." +bold "Updating with PACMAN..." +s "pacman -Syu --color always" echo +bold "Updating with AURMAN..." aurman -Su --noedit --noconfirm --color always echo -echo bold "Cleaning stuff..." -echo -echo "$sudoPass\n" | yes | (sudo -nS pacman -Rns $(pacman -Qtdq) --color always) +echo -e "$sudoPass\n" | yes | (sudo -S pacman -Rns $(pacman -Qtdq) --color always) echo notify-send "Update script has finished!"