aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-04-29 18:37:47 -0400
committerMarcoFalke <falke.marco@gmail.com>2018-04-29 18:33:25 -0400
commitfa85de9ff5cfa85a76026b1b6138ba1d7b54864a (patch)
tree16ab62219d13d07e0400fba28f8da6be55cb4517
parent17266a13067c061783e0428c6200985ed8872b16 (diff)
Remove script to clean up datadirs
This reverts commit 33c055c4f1eca07bd914a5b40a21f92ad82dde9f. (#2295)
-rwxr-xr-xcontrib/tidy_datadir.sh62
1 files changed, 0 insertions, 62 deletions
diff --git a/contrib/tidy_datadir.sh b/contrib/tidy_datadir.sh
deleted file mode 100755
index b845b34e41..0000000000
--- a/contrib/tidy_datadir.sh
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2013 The Bitcoin Core developers
-# Distributed under the MIT software license, see the accompanying
-# file COPYING or http://www.opensource.org/licenses/mit-license.php.
-
-if [ -d "$1" ]; then
- cd "$1" || exit 1
-else
- echo "Usage: $0 <datadir>" >&2
- echo "Removes obsolete Bitcoin database files" >&2
- exit 1
-fi
-
-LEVEL=0
-if [ -f wallet.dat -a -f addr.dat -a -f blkindex.dat -a -f blk0001.dat ]; then LEVEL=1; fi
-if [ -f wallet.dat -a -f peers.dat -a -f blkindex.dat -a -f blk0001.dat ]; then LEVEL=2; fi
-if [ -f wallet.dat -a -f peers.dat -a -f coins/CURRENT -a -f blktree/CURRENT -a -f blocks/blk00000.dat ]; then LEVEL=3; fi
-if [ -f wallet.dat -a -f peers.dat -a -f chainstate/CURRENT -a -f blocks/index/CURRENT -a -f blocks/blk00000.dat ]; then LEVEL=4; fi
-
-case $LEVEL in
- 0)
- echo "Error: no Bitcoin datadir detected."
- exit 1
- ;;
- 1)
- echo "Detected old Bitcoin datadir (before 0.7)."
- echo "Nothing to do."
- exit 0
- ;;
- 2)
- echo "Detected Bitcoin 0.7 datadir."
- ;;
- 3)
- echo "Detected Bitcoin pre-0.8 datadir."
- ;;
- 4)
- echo "Detected Bitcoin 0.8 datadir."
- ;;
-esac
-
-FILES=""
-DIRS=""
-
-if [ $LEVEL -ge 3 ]; then FILES=$(echo $FILES blk????.dat blkindex.dat); fi
-if [ $LEVEL -ge 2 ]; then FILES=$(echo $FILES addr.dat); fi
-if [ $LEVEL -ge 4 ]; then DIRS=$(echo $DIRS coins blktree); fi
-
-for FILE in $FILES; do
- if [ -f $FILE ]; then
- echo "Deleting: $FILE"
- rm -f $FILE
- fi
-done
-
-for DIR in $DIRS; do
- if [ -d $DIR ]; then
- echo "Deleting: $DIR/"
- rm -rf $DIR
- fi
-done
-
-echo "Done."