From c72e728ffd8f5b83e86814823dae026635571add Mon Sep 17 00:00:00 2001 From: root Date: Fri, 26 May 2023 15:40:44 +0000 Subject: [PATCH] Added upgrade to latest patches before installing --- lib/functions.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/functions.sh b/lib/functions.sh index 63305b2..458f2f7 100644 --- a/lib/functions.sh +++ b/lib/functions.sh @@ -243,6 +243,21 @@ rm /federated/apps/mail/data/root/certs/mailfile check_docker() { OSRELEASE=`lsb_release -a 2>/dev/null | grep ID | awk -F: '{ print $2 }' | xargs` + echo -ne "\n* Updating OS with the latest patches.." + spin & + SPINPID=$! + + # Update OS with latest patches + sudo apt-get update -y &> /dev/null + [ $? -ne 0 ] && failcheck "Couldn't run sudo apt-get update" + + NEEDRESTART_MODE=a apt-get upgrade -y &> /dev/null + [ $? -ne 0 ] && failcheck "Couldn't run sudo apt-get upgrade" + + kill -9 $SPINPID &> /dev/null + echo -ne "done." + + # Install docker if not found if ! command -v docker &> /dev/null; then echo -ne "\n* Couldn't find docker, installing.." spin &