clear-config.sh now works with a secondary disk (#5135)

This commit is contained in:
Michael Vines
2019-07-16 19:09:14 -07:00
committed by GitHub
parent 94db9cd412
commit 349e5001d6
2 changed files with 11 additions and 6 deletions

View File

@@ -72,13 +72,16 @@ SOLANA_RSYNC_CONFIG_DIR=$SOLANA_ROOT/config
# Configuration that remains local
SOLANA_CONFIG_DIR=$SOLANA_ROOT/config-local
# If there is a secondary disk, symlink the config-local dir there
SECONDARY_DISK_MOUNT_POINT=/mnt/extra-disk
if [[ -d $SECONDARY_DISK_MOUNT_POINT ]]; then
mkdir -p $SECONDARY_DISK_MOUNT_POINT/config-local
mkdir -p "$SOLANA_ROOT"
ln -s $SECONDARY_DISK_MOUNT_POINT/config-local "$SOLANA_ROOT"
fi
setup_secondary_mount() {
# If there is a secondary disk, symlink the config-local dir there
if [[ -d $SECONDARY_DISK_MOUNT_POINT ]]; then
mkdir -p $SECONDARY_DISK_MOUNT_POINT/config-local
rm -rf "$SOLANA_CONFIG_DIR"
ln -sfT $SECONDARY_DISK_MOUNT_POINT/config-local "$SOLANA_CONFIG_DIR"
fi
}
setup_secondary_mount
default_arg() {
declare name=$1