Highly Available and Scalable Information System
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.3 KiB

6 years ago
#!/bin/bash
#EuryBOX main functions file
6 years ago
#INTERNAL VARIABLES
declare -A EURYBOX_DETECTED_ARCHIVES
declare -A EURYBOX_DETECTED_ARCHIVE_VMS
6 years ago
declare -A EURYBOX_DETECTED_DISKS
declare -A EURYBOX_DETECTED_DOMAINS
declare -A EURYBOX_DETECTED_HYPERVISOR
declare -A EURYBOX_DETECTED_INTERFACES
declare -A EURYBOX_DETECTED_NETWORK_FILTERS
declare -A EURYBOX_DETECTED_NETWORKS
declare -A EURYBOX_DETECTED_NODE_DEVICES
declare -A EURYBOX_DETECTED_SECRETS
declare -A EURYBOX_DETECTED_SNAPSHOTS
declare -A EURYBOX_DETECTED_STORAGE_POOLS
declare -A EURYBOX_DETECTED_STORAGE_VOLUMES
declare -A EURYBOX_RESTORE_TARGET_ARCHIVE
6 years ago
#Detect and source all function files
FUNCTIONS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6 years ago
if [[ $FUNCTIONS_DIR != "" ]]
then
#To avoid bad behavior in case of no file found
shopt -s nullglob
for FUNC_FILE in $FUNCTIONS_DIR/*.functions.*
6 years ago
do
source $FUNC_FILE
SOURCED_FILES="$SOURCED_FILES $FUNC_FILE"
6 years ago
done
if [[ $SOURCED_FILES != "" ]]
6 years ago
then
eurybox_display_message debug FUNCTIONS "Function scripts successfully sourced from directory $FUNCTIONS_DIR : $SOURCED_FILES"
6 years ago
else
echo "[EURYBOX][ERROR][RESSOURCES] No functions scripts found in directory $FUNCTIONS_DIR. Stopping execution"
exit 1
6 years ago
fi
else
echo "[EURYBOX][ERROR][RESSOURCES] Function directory discovery failed. Stopping execution"
exit 1
fi