Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions update.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@

#!/bin/bash

# Color variables
red='\033[05;01;31m'
green='\033[05;01;32m'
# reset the color after that
reset='\033[0m'

exit_status() {
if [ $? -eq 0 ]
then
echo
echo "-----------------------------------------"
echo ">>> Command Execting Was Successful <<<"
echo -e ">>>${green} Command Execting Was Successful ${reset}<<<"
echo "-----------------------------------------"
echo
sleep 2
clear
else
echo
echo "-------------------------------------------------------"
echo ">>> [Error] Process Command Executing Has Failed! <<<"
echo -e ">>>${red} [Error] Process Command Executing Has Failed! ${reset}<<<"
echo "-------------------------------------------------------"
echo

Expand All @@ -24,17 +31,14 @@ exit_status() {
fi
}

start() {
upgrade() {
echo
echo "***>>> Upgrading The Operating System <<<***"
echo -e "***>>>${green}Upgrading The Operating System${reset}<<<***"
echo
}

upgrade() {
sudo apt update;
exit_status

sudo apt upgrade;
"yes" | sudo apt upgrade;
exit_status
}

Expand All @@ -47,14 +51,13 @@ exitUpdate() {

echo
echo "-------------------------------------------------------"
echo ">>>> Operating System Update Has Been Completed <<<<"
echo -e ">>>>${green} Operating System Update Has Been Completed ${reset}<<<<"
echo "-------------------------------------------------------"
echo
exit
}

#calls the functions
start
upgrade
cleanUp
exitUpdate