Skip to content

Commit

Permalink
Update optimizer.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
opiran-club authored Oct 15, 2023
1 parent 802d06e commit e6d95b4
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions optimizer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -182,26 +182,27 @@ complete_update() {
echo ""
echo ""

SPINNER="/-\\|"
SPINNER_INDEX=0
SPINNER_SIZE=100

PROGRESS="["
for ((i = 0; i < SPINNER_SIZE; i++)); do
PROGRESS="${PROGRESS}"
done
PROGRESS="${PROGRESS}]"

spin() {
local c
c=${SPINNER:SPINNER_INDEX%4:1}
echo -ne "${RED}[${c}] ${NC}"
SPINNER_INDEX=$((SPINNER_INDEX + 1))
echo -ne "\r${RED}${PROGRESS}${NC}"
sleep 0.1
}

while true; do
PROGRESS="[▓${PROGRESS:2}]"
spin
sleep 0.1
echo -ne "\b\b\b\b\b"
[[ $SPINNER_INDEX -eq 4 ]] && SPINNER_INDEX=0
done &

SPIN_PID=$!

apt-get update > /dev/null 2>&1
apt-get update 2>&1 | tee /dev/tty > /dev/null
apt-get upgrade -y > /dev/null 2>&1
apt-get dist-upgrade -y > /dev/null 2>&1
apt-get autoremove -y > /dev/null 2>&1
Expand All @@ -211,7 +212,7 @@ complete_update() {
kill $SPIN_PID > /dev/null 2>&1
wait $SPIN_PID > /dev/null 2>&1

echo -e "\e[K"
echo -e "\r\e[K"

echo -e "\e[0m"

Expand All @@ -222,7 +223,6 @@ complete_update() {
press_enter
}


installations() {
clear
title="Install necessary packages"
Expand Down

0 comments on commit e6d95b4

Please sign in to comment.