#!/bin/bash #EuryBOX update script START_TIME=$(date +%s) ######################### # SCRIPT INITIALISATION # ######################### #Get configuration variables and functions SCRIPT_COMMAND=$(readlink -f "$0") SCRIPT_ARGUMENTS="$@" SCRIPT_PATH=$(dirname "$SCRIPT_COMMAND") #Should not be changed except if you changed sw folder layout SCRIPT_CONF_PATH=$SCRIPT_PATH/../../../../../cfg/sw/eurybox.conf SCRIPT_FUNC_PATH=$SCRIPT_PATH/../../../eurybox.functions #Check and load ressources if [[ -f $SCRIPT_CONF_PATH && -f $SCRIPT_FUNC_PATH ]] then source $SCRIPT_CONF_PATH source $SCRIPT_FUNC_PATH eurybox_display_message debug STATUS "Configuration and function scripts successfully sourced" else echo "[EURYBOX][ERROR][RESSOURCES] Configuration file $SCRIPT_CONF_PATH or functions file $SCRIPT_FUNC_PATH not found. Stopping execution" exit 1 fi eurybox_display_message message STATUS "Checking configuration" eurybox_check_configuration UPDATE #Check input parameters eurybox_display_message message STATUS "Checking parameters" eurybox_check_arguments $SCRIPT_ARGUMENTS #Check environment eurybox_display_message message STATUS "Checking environment" eurybox_check_environment UPDATE eurybox_display_message message STATUS "$EURYBOX_CORPORATE update script started" #Make sure all VM are started euryboxctrl_start_services if [[ ${EURYBOX_UPDATE_LOCAL_REPOSITORIES_ACTIVATED} = "true" ]] then #Update local repository euryboxctrl_update_local_repository fi #Update the physical machine euryboxctrl_update_hypervisor #Update virtual machines / services euryboxctrl_update_services #Finished END_TIME=$(date +%s) DIFF_TIME=$(( $END_TIME - $START_TIME )) eurybox_display_message message STATUS "Update finished" eurybox_display_message message TIMING "Update took $DIFF_TIME seconds"