From 98018251acfa3d75a82a328c82c345bff5e25548 Mon Sep 17 00:00:00 2001 From: Daniel Goldberg Date: Sat, 4 Jan 2020 22:52:56 +0200 Subject: [PATCH] Added error handling for pushd failing. --- monkey/monkey_island/linux/install_mongo.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/monkey/monkey_island/linux/install_mongo.sh b/monkey/monkey_island/linux/install_mongo.sh index 7afe95ff3..baaf39ac9 100755 --- a/monkey/monkey_island/linux/install_mongo.sh +++ b/monkey/monkey_island/linux/install_mongo.sh @@ -26,7 +26,10 @@ else fi TEMP_MONGO=$(mktemp -d) -pushd "${TEMP_MONGO}" +pushd "${TEMP_MONGO}" || { + echo "Pushd failed" + exit 1 +} if exists bash; then wget ${tgz_url} -O mongodb.tgz @@ -40,7 +43,10 @@ else fi tar -xf mongodb.tgz -popd +popd || { + echo "popd failed" + exit 1 +} mkdir -p "${MONGODB_DIR}"/bin mkdir -p "${MONGODB_DIR}"/db