buildd/functions.sh: do not mv files if there was an error
[grml-live.git] / buildd / functions.sh
index d5c65ef..d33955b 100755 (executable)
@@ -94,8 +94,10 @@ mutt -s "$SCRIPTNAME [${DATE}] - $RC_INFO" \
 
 # make sure we store the final iso:
 store_iso() {
-  [ -d "$ISO_DIR" ] || mkdir "$ISO_DIR"
-  mv $OUTPUT_DIR/grml_isos/$ISO_NAME $ISO_DIR
+  if [ "$RC" = "0" ] ; then
+     [ -d "$ISO_DIR" ] || mkdir "$ISO_DIR"
+     mv $OUTPUT_DIR/grml_isos/$ISO_NAME $ISO_DIR
+  fi
 }
 
 # allow clean exit: