From 80c95b9b803e72957a94ca3e72bdabc0c4ffb9d9 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 23 Nov 2017 18:27:03 +0000 Subject: [PATCH] Check file for zero size --- src/freedombone-utils-mongodb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/freedombone-utils-mongodb b/src/freedombone-utils-mongodb index b6a96554..3ad23153 100755 --- a/src/freedombone-utils-mongodb +++ b/src/freedombone-utils-mongodb @@ -103,8 +103,7 @@ function remove_mongodb { removemongo= if [ -f $MONGODB_APPS_FILE ]; then sed -i "/$app_name/d" $MONGODB_APPS_FILE - mongoapps=$(cat $MONGODB_APPS_FILE) - if [ ${#mongoapps} -lt 3 ]; then + if [ ! -s $MONGODB_APPS_FILE ]; then removemongo=1 fi else @@ -113,6 +112,7 @@ function remove_mongodb { if [ $removemongo ]; then apt-get -yq remove mongodb mongo-tools + apt-get -yq autoremove if [ -d /var/lib/mongodb ]; then rm -rf /var/lib/mongodb fi