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 &