Improve security by removing password from variable

This commit is contained in:
Bruno F. Fontes 2021-02-19 23:23:12 -03:00
parent 584b15b88b
commit 7424440645
Signed by: brunofontes
GPG Key ID: EE3447CE80048495

View File

@ -6,26 +6,26 @@ function bold() {
} }
function s() { function s() {
echo -e "$sudoPass\n" | sudo -S $1 #echo -e "$sudoPass\n" | sudo --stdin $1 || exit 1
sudo $1
echo echo
} }
sudo -k
echo -n Please type your sudo password: # bold "Pacman-mirrors -c"
read -s sudoPass # s "pacman-mirrors -c Brazil"
# s "reflector -l 30 -f 10 --save /etc/pacman.d/mirrorlist"
s -v
echo echo
s "echo '**********'" bold "Updating..."
yay -Syu --sudoloop --noconfirm --nobatchinstall --cleanafter
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 "Cleaning stuff..." bold "Cleaning stuff..."
s "echo" s -v
yes | (sudo -S pacman -Rns $(pacman -Qtdq) --color always) yes | (sudo -S pacman -Rns $(pacman -Qtdq) --color always)
s -v
yay -Sc --noconfirm
s -k
notify-send "Update script has finished!" notify-send "Update script has finished!"