Check file for zero size
This commit is contained in:
parent
8e3a997fcb
commit
80c95b9b80
|
@ -103,8 +103,7 @@ function remove_mongodb {
|
||||||
removemongo=
|
removemongo=
|
||||||
if [ -f $MONGODB_APPS_FILE ]; then
|
if [ -f $MONGODB_APPS_FILE ]; then
|
||||||
sed -i "/$app_name/d" $MONGODB_APPS_FILE
|
sed -i "/$app_name/d" $MONGODB_APPS_FILE
|
||||||
mongoapps=$(cat $MONGODB_APPS_FILE)
|
if [ ! -s $MONGODB_APPS_FILE ]; then
|
||||||
if [ ${#mongoapps} -lt 3 ]; then
|
|
||||||
removemongo=1
|
removemongo=1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
@ -113,6 +112,7 @@ function remove_mongodb {
|
||||||
|
|
||||||
if [ $removemongo ]; then
|
if [ $removemongo ]; then
|
||||||
apt-get -yq remove mongodb mongo-tools
|
apt-get -yq remove mongodb mongo-tools
|
||||||
|
apt-get -yq autoremove
|
||||||
if [ -d /var/lib/mongodb ]; then
|
if [ -d /var/lib/mongodb ]; then
|
||||||
rm -rf /var/lib/mongodb
|
rm -rf /var/lib/mongodb
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue