Remove created lockfile

This commit is contained in:
Michael Vines 2019-04-26 21:36:20 -07:00
parent 634d8e25ee
commit b6558a2ef3
No known key found for this signature in database
GPG Key ID: 33F4FDEC4E0E88BD
1 changed files with 2 additions and 14 deletions

View File

@ -368,33 +368,21 @@ deploy() {
} }
ENABLED_LOCKFILE="${HOME}/${TESTNET}.is_enabled" ENABLED_LOCKFILE="${HOME}/${TESTNET}.is_enabled"
CREATED_LOCKFILE="${HOME}/${TESTNET}.is_created"
create-and-start() { create-and-start() {
rm -f "${CREATED_LOCKFILE}"
deploy create start deploy create start
touch "${CREATED_LOCKFILE}"
} }
create() { create() {
rm -f "${CREATED_LOCKFILE}"
deploy create deploy create
touch "${CREATED_LOCKFILE}"
} }
start() { start() {
if [[ -f ${CREATED_LOCKFILE} ]]; then deploy "" start
deploy "" start
else
echo "Unable to start ${TESTNET}. Are the nodes created?
Re-run ci/testnet-manager.sh with \$TESTNET_OP=create or \$TESTNET_OP=create-and-start"
exit 1
fi
} }
stop() { stop() {
deploy "" "" deploy "" ""
} }
delete() { delete() {
deploy "" "" "" delete deploy "" "" "" delete
rm -f "${CREATED_LOCKFILE}"
} }
enable_testnet() { enable_testnet() {
touch "${ENABLED_LOCKFILE}" touch "${ENABLED_LOCKFILE}"
@ -406,7 +394,7 @@ disable_testnet() {
} }
is_testnet_enabled() { is_testnet_enabled() {
if [[ ! -f ${ENABLED_LOCKFILE} ]]; then if [[ ! -f ${ENABLED_LOCKFILE} ]]; then
echo "--- ${TESTNET} is currently disabled. Enable ${TESTNET} by running ci/testnet-manager.sh with \$TESTNET_OP=enable, then re-run with current settings." echo "+++ ${TESTNET} is currently disabled. Enable ${TESTNET} by running ci/testnet-manager.sh with \$TESTNET_OP=enable, then re-run with current settings."
exit 0 exit 0
fi fi
} }