Skip to content

Commit

Permalink
Download and extract DB files at once rather than first save to file
Browse files Browse the repository at this point in the history
  • Loading branch information
nuriel77 committed Jun 11, 2018
1 parent 3004e79 commit 2be44d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,7 @@ You can use the ``iric`` tool to download and install the database :ref:`iric`,

.. code:: bash
cd /tmp && wget -O iota.db.tgz https://x-vps.com/iota.db.tgz && systemctl stop iri && rm -rf /var/lib/iri/target/mainnetdb* && mkdir /var/lib/iri/target/mainnetdb/ && pv iota.db.tgz | tar xzf - -C /var/lib/iri/target/mainnetdb/ && chown iri.iri /var/lib/iri -R && rm -f /tmp/iota.db.tgz && systemctl start iri
systemctl stop iri && rm -rf /var/lib/iri/target/mainnetdb* && mkdir /var/lib/iri/target/mainnetdb && cd /var/lib/iri/target/mainnetdb && wget -O - https://x-vps.com/iota.db.tgz | tar zxv && chown iri.iri /var/lib/iri -R systemctl start iri
.. raw:: html

Expand Down
6 changes: 2 additions & 4 deletions roles/iri/files/iric
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fi
clear
[ -f "$HOME/.iric" ] && . "$HOME/.iric"
EDITOR="${EDITOR:-nano}"
VERSION=0.4.7
VERSION=0.4.8
CUR_DIR=$(pwd)
WIDTH=78
export NEWT_COLORS='
Expand Down Expand Up @@ -706,13 +706,11 @@ function get_db() {
if (whiptail --title "Confirm DB" \
--yesno "Download new database from '$DB_SOURCE'?\n\nupdated: ${LAST_UPDATED}, size: ${FILE_SIZE}" \
12 $WIDTH) then
TFILE=$(mktemp /tmp/iota.db.tgz.XXXXXXXXX)
cd /tmp && wget -O $TFILE "$DB_SOURCE" && systemctl stop iri && rm -rf /var/lib/iri/target/mainnetdb* && mkdir /var/lib/iri/target/mainnetdb/ && echo "Extracting DB files..." && pv $TFILE | tar xzf - -C /var/lib/iri/target/mainnetdb/ && chown iri.iri /var/lib/iri -R && rm -f $TFILE && systemctl start iri
systemctl stop iri && rm -rf /var/lib/iri/target/mainnetdb* && mkdir /var/lib/iri/target/mainnetdb && cd /var/lib/iri/target/mainnetdb && wget -O - "$DB_SOURCE" | tar zxv && chown iri.iri /var/lib/iri -R systemctl start iri
if [[ $? -ne 0 ]]; then
whiptail --title "New DB Failed!" \
--msgbox "Well this is embarrassing. Downloading the new DB failed..." \
8 $WIDTH
rm -f $TFILE
return 1
else
pause "Done! Please check IRI's status and logs to verify it is error free."
Expand Down

0 comments on commit 2be44d3

Please sign in to comment.