Add error handling: exit if cd fails

This commit is contained in:
practicalswift
2017-10-04 21:19:45 +02:00
parent b9e79ab415
commit 1e44ae0e19
3 changed files with 3 additions and 3 deletions

View File

@@ -4,7 +4,7 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
if [ -d "$1" ]; then
cd "$1"
cd "$1" || exit 1
else
echo "Usage: $0 <datadir>" >&2
echo "Removes obsolete Bitcoin database files" >&2