Explorar el Código

Check file for zero size

Bob Mottram hace 7 años
padre
commit
80c95b9b80
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2
    2
      src/freedombone-utils-mongodb

+ 2
- 2
src/freedombone-utils-mongodb Ver fichero

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