浏览代码

Check file for zero size

Bob Mottram 7 年前
父节点
当前提交
80c95b9b80
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      src/freedombone-utils-mongodb

+ 2
- 2
src/freedombone-utils-mongodb 查看文件

103
     removemongo=
103
     removemongo=
104
     if [ -f $MONGODB_APPS_FILE ]; then
104
     if [ -f $MONGODB_APPS_FILE ]; then
105
         sed -i "/$app_name/d" $MONGODB_APPS_FILE
105
         sed -i "/$app_name/d" $MONGODB_APPS_FILE
106
-        mongoapps=$(cat $MONGODB_APPS_FILE)
107
-        if [ ${#mongoapps} -lt 3 ]; then
106
+        if [ ! -s $MONGODB_APPS_FILE ]; then
108
             removemongo=1
107
             removemongo=1
109
         fi
108
         fi
110
     else
109
     else
113
 
112
 
114
     if [ $removemongo ]; then
113
     if [ $removemongo ]; then
115
         apt-get -yq remove mongodb mongo-tools
114
         apt-get -yq remove mongodb mongo-tools
115
+        apt-get -yq autoremove
116
         if [ -d /var/lib/mongodb ]; then
116
         if [ -d /var/lib/mongodb ]; then
117
             rm -rf /var/lib/mongodb
117
             rm -rf /var/lib/mongodb
118
         fi
118
         fi