]> git.donarmstrong.com Git - bin.git/commitdiff
only move the file if it's not the same
authorDon Armstrong <don@donarmstrong.com>
Wed, 24 Jul 2019 00:41:03 +0000 (17:41 -0700)
committerDon Armstrong <don@donarmstrong.com>
Wed, 24 Jul 2019 00:41:03 +0000 (17:41 -0700)
learn_from_spam

index 573a8c1c929e67c836ab05531aa13ed6143ff88c..8d3b2c88b9553eef05ca0a05c3c4e63d691a0f81 100755 (executable)
@@ -24,7 +24,9 @@ run_through_spamc () {
     DESTFILE_NO_SIZE="$DESTDIR/$(basename "$FILENAME"|sed 's/,S=.*//g')"
     spamc -s $((100 * 1024 * 1024)) < "$FILENAME" > "$TMP/file" 2>/dev/null;
     mv "$TMP/file" "$DESTFILE"
-    mv "$DESTFILE" "$DESTFILE_NO_SIZE"
+    if [ "$DESTFILE" -ne "$DESTFILE_NO_SIZE" ]; then
+        mv "$DESTFILE" "$DESTFILE_NO_SIZE"
+    fi;
     trap - EXIT;
     rmdir "$TMP";
 }