From c19c418ef7fe54f47eab4a983f46ca15ac9b8f0a Mon Sep 17 00:00:00 2001 From: Bruno Fontes Date: Wed, 8 Aug 2018 23:56:36 -0300 Subject: [PATCH] Trying to fix bug with sudo password --- Pacman/updateRepositories.sh | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/Pacman/updateRepositories.sh b/Pacman/updateRepositories.sh index a471da3..fc00328 100755 --- a/Pacman/updateRepositories.sh +++ b/Pacman/updateRepositories.sh @@ -1,13 +1,31 @@ +BOLD='\e[91m' +NC='\e[39m' + +function bold() { + echo -e "${BOLD}$1${NC}" +} + echo -n Please type your sudo password: read -s sudoPass -echo; -echo "$sudoPass" | sudo -S pacman-mirrors -g echo -echo Updating with Pacman... echo -echo "$sudoPass" | sudo -S pacman -Syu --color always -echo; +bold "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..." +echo aurman -Su --noedit --noconfirm --color always -echo; -echo "$sudoPass" | yes | (sudo -S pacman -Rns $(pacman -Qtdq) --color always) +echo +echo +bold "Cleaning stuff..." +echo +echo "$sudoPass\n" | yes | (sudo -nS pacman -Rns $(pacman -Qtdq) --color always) +echo notify-send "Update script has finished!"