@ -15,8 +15,9 @@ netConfigDir="$netDir"/config
|
||||
netLogDir="$netDir"/log
|
||||
mkdir -p "$netConfigDir" "$netLogDir"
|
||||
|
||||
SOLANA_ROOT="$netDir"/..
|
||||
# shellcheck source=scripts/configure-metrics.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")"/../scripts/configure-metrics.sh
|
||||
source "$SOLANA_ROOT"/scripts/configure-metrics.sh
|
||||
|
||||
configFile="$netConfigDir/config"
|
||||
geoipConfigFile="$netConfigDir/geoip.yml"
|
||||
@ -94,3 +95,28 @@ urlencode() {
|
||||
done
|
||||
}
|
||||
|
||||
SOLANA_CONFIG_DIR=$SOLANA_ROOT/config
|
||||
# Clear the current cluster configuration
|
||||
clear_config_dir() {
|
||||
declare config_dir="$1"
|
||||
(
|
||||
set -x
|
||||
rm -rf "${config_dir:?}/" # <-- $i might be a symlink, rm the other side of it first
|
||||
rm -rf "$config_dir"
|
||||
mkdir -p "$config_dir"
|
||||
)
|
||||
|
||||
setup_secondary_mount
|
||||
}
|
||||
|
||||
SECONDARY_DISK_MOUNT_POINT=/mnt/extra-disk
|
||||
setup_secondary_mount() {
|
||||
# If there is a secondary disk, symlink the config/ dir there
|
||||
if [[ -d $SECONDARY_DISK_MOUNT_POINT ]] && \
|
||||
[[ -w $SECONDARY_DISK_MOUNT_POINT ]]; then
|
||||
mkdir -p $SECONDARY_DISK_MOUNT_POINT/config
|
||||
rm -rf "$SOLANA_CONFIG_DIR"
|
||||
ln -sfT $SECONDARY_DISK_MOUNT_POINT/config "$SOLANA_CONFIG_DIR"
|
||||
fi
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user