APT_INSTALL="sudo LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y"
# Upgrade
-if which hydractl &> /dev/null; then
- hydractl upgrade
-else
- sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get autoremove -y && sudo apt-get clean || exit 1
+if [ "$PROVISION_UPGRADED" != "1" ]; then
+ if which hydractl &> /dev/null; then
+ hydractl upgrade
+ else
+ sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get autoremove -y && sudo apt-get clean || exit 1
+ fi
+
+ export PROVISION_UPGRADED="1"
fi
# Dependencies
MIRROR="$3"
# Run
-sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get autoremove -y && sudo apt-get clean
-sudo apt-get install -y apache2
+if [ "$PROVISION_UPGRADED" != "1" ]; then
+ sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get autoremove -y && sudo apt-get clean
+ sudo apt-get install -y apache2
+ export PROVISION_UPGRADED="1"
+fi