Check file for zero size

This commit is contained in:
Bob Mottram 2017-11-23 18:27:03 +00:00
parent 8e3a997fcb
commit 80c95b9b80
1 changed files with 2 additions and 2 deletions

View File

@ -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