Check file for zero size
This commit is contained in:
parent
8e3a997fcb
commit
80c95b9b80
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue