From cbbd70314dd7c2f4f9ea1185c0b755c75716afc0 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Sat, 1 Oct 2016 06:59:26 +0200 Subject: [PATCH] fix error on startup if blockchain cache file does not exist --- contrib/steemd.run | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/contrib/steemd.run b/contrib/steemd.run index 4cf9ca46e3..9262670fc3 100644 --- a/contrib/steemd.run +++ b/contrib/steemd.run @@ -62,12 +62,14 @@ cp /etc/steemd/config.ini $HOME/config.ini chown steemd:steemd $HOME/config.ini if [[ ! -d $HOME/blockchain ]]; then - # init with blockchain cached in image - ARGS+=" --replay-blockchain" - mkdir -p $HOME/blockchain/database - cd $HOME/blockchain/database - tar xvjpf /var/cache/steemd/blocks.tbz2 - chown -R steemd:steemd $HOME/blockchain + if [[ -e /var/cache/steemd/blocks.tbz2 ]]; then + # init with blockchain cached in image + ARGS+=" --replay-blockchain" + mkdir -p $HOME/blockchain/database + cd $HOME/blockchain/database + tar xvjpf /var/cache/steemd/blocks.tbz2 + chown -R steemd:steemd $HOME/blockchain + fi fi # without --data-dir it uses cwd as datadir(!)