From 7424440645404852bac5a68d415aa8b564caeedf Mon Sep 17 00:00:00 2001 From: Bruno Fontes Date: Fri, 19 Feb 2021 23:23:12 -0300 Subject: [PATCH] Improve security by removing password from variable --- Pacman/updateRepositories.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Pacman/updateRepositories.sh b/Pacman/updateRepositories.sh index bf0a6a1..1bb8f4c 100755 --- a/Pacman/updateRepositories.sh +++ b/Pacman/updateRepositories.sh @@ -6,26 +6,26 @@ function bold() { } function s() { - echo -e "$sudoPass\n" | sudo -S $1 + #echo -e "$sudoPass\n" | sudo --stdin $1 || exit 1 + sudo $1 echo } -sudo -k -echo -n Please type your sudo password: -read -s sudoPass + +# bold "Pacman-mirrors -c" +# s "pacman-mirrors -c Brazil" +# s "reflector -l 30 -f 10 --save /etc/pacman.d/mirrorlist" + +s -v echo -s "echo '**********'" - -bold "Pacman-mirrors -c" -s "pacman-mirrors -c Brazil" -s "reflector -l 30 -f 10 --save /etc/pacman.d/mirrorlist" - -bold "Updating with AURMAN..." -s "echo" -yay -Syu --sudoloop --noconfirm --nobatchinstall +bold "Updating..." +yay -Syu --sudoloop --noconfirm --nobatchinstall --cleanafter bold "Cleaning stuff..." -s "echo" +s -v yes | (sudo -S pacman -Rns $(pacman -Qtdq) --color always) +s -v +yay -Sc --noconfirm +s -k notify-send "Update script has finished!"