Improve control flow.
This commit is contained in:
parent
5dc7194a62
commit
786d34df93
@ -120,8 +120,7 @@ if ! lxc list --format csv | grep -q ss-mgmt; then
|
|||||||
if [ -d "$BITCOIN_MAINNET_BLOCKS_PATH" ]; then
|
if [ -d "$BITCOIN_MAINNET_BLOCKS_PATH" ]; then
|
||||||
lxc config device add ss-mgmt ss-mainnet-blocks disk source="$BITCOIN_MAINNET_BLOCKS_PATH" path=$REMOTE_BITCOIN_CACHE_PATH/mainnet/blocks
|
lxc config device add ss-mgmt ss-mainnet-blocks disk source="$BITCOIN_MAINNET_BLOCKS_PATH" path=$REMOTE_BITCOIN_CACHE_PATH/mainnet/blocks
|
||||||
else
|
else
|
||||||
echo "WARNING: the blocks directory was not found for mainnet. It will NOT be mounted into ss-mgmt."
|
echo "INFO: the blocks directory was not found for mainnet. It will NOT be mounted into ss-mgmt."
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if a ~/.bitcoin/testnet3/blocks direrectory exists, mount it in.
|
# if a ~/.bitcoin/testnet3/blocks direrectory exists, mount it in.
|
||||||
@ -129,8 +128,7 @@ if ! lxc list --format csv | grep -q ss-mgmt; then
|
|||||||
if [ -d "$BITCOIN_MAINNET_CHAINSTATE_PATH" ]; then
|
if [ -d "$BITCOIN_MAINNET_CHAINSTATE_PATH" ]; then
|
||||||
lxc config device add ss-mgmt ss-mainnet-chainstate disk source="$BITCOIN_MAINNET_CHAINSTATE_PATH" path=$REMOTE_BITCOIN_CACHE_PATH/mainnet/chainstate
|
lxc config device add ss-mgmt ss-mainnet-chainstate disk source="$BITCOIN_MAINNET_CHAINSTATE_PATH" path=$REMOTE_BITCOIN_CACHE_PATH/mainnet/chainstate
|
||||||
else
|
else
|
||||||
echo "WARNING: the chainstate directory was not found for mainnet. It will NOT be mounted into ss-mgmt."
|
echo "INFO: the chainstate directory was not found for mainnet. It will NOT be mounted into ss-mgmt."
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# mount the ssh directory in there.
|
# mount the ssh directory in there.
|
||||||
|
@ -7,6 +7,11 @@ if ! lxc remote get-default | grep -q "local"; then
|
|||||||
lxc remote switch "local"
|
lxc remote switch "local"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! lxc list -q --format csv | grep -q ss-mgmt; then
|
||||||
|
echo "ERROR: the 'ss-mgmt' VM does not exist. You may need to run install.sh"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# if the mgmt machine doesn't exist, then warn the user to perform ./install.sh
|
# if the mgmt machine doesn't exist, then warn the user to perform ./install.sh
|
||||||
if ! lxc list --format csv | grep -q "ss-mgmt"; then
|
if ! lxc list --format csv | grep -q "ss-mgmt"; then
|
||||||
echo "ERROR: the management machine VM does not exist. You probably need to run './install.sh'."
|
echo "ERROR: the management machine VM does not exist. You probably need to run './install.sh'."
|
||||||
|
Loading…
Reference in New Issue
Block a user