Created
April 6, 2022 17:54
-
-
Save spy86/8c846a1e29320c8fbf7d08129e53ee63 to your computer and use it in GitHub Desktop.
Simple bash script for upgrade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TEXT_RESET='\e[0m' | |
TEXT_YELLOW='\e[0;33m' | |
TEXT_RED_B='\e[1;31m' | |
sudo apt-get update | |
echo -e $TEXT_YELLOW | |
echo 'APT update finished...' | |
echo -e $TEXT_RESET | |
echo -e $TEXT_YELLOW | |
echo 'See upgradable packages ' | |
echo -e $TEXT_RESET | |
apt list --upgradable | |
echo -e $TEXT_YELLOW | |
read -p "Are you sure to start upgrade? " -n 1 -r | |
echo -e $TEXT_RESET | |
if [[ $REPLY =~ ^[Yy]$ ]] | |
then | |
sudo apt-get upgrade | |
echo -e $TEXT_YELLOW | |
echo 'APT upgrade finished...' | |
echo -e $TEXT_RESET | |
apt -y autoremove | |
echo -e $TEXT_YELLOW | |
echo 'APT autoremove finished...' | |
echo -e $TEXT_RESET | |
apt clean | |
echo -e $TEXT_YELLOW | |
echo 'APT clean finished...' | |
echo -e $TEXT_RESET | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment