diff moefetch.sh @ 217:77cd21d714f6

screwup fix
author edhoprima@gmail.com <edhoprima@gmail.com>
date Thu, 02 Jul 2009 20:25:27 +0000
parents a869987c4646
children aeca29670e26
line wrap: on
line diff
--- a/moefetch.sh	Thu Jul 02 20:06:43 2009 +0000
+++ b/moefetch.sh	Thu Jul 02 20:25:27 2009 +0000
@@ -227,19 +227,21 @@
 		> "${TEMP_PREFIX}-ok"
 		for file in "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}/"*
 		do
-			if test -n "$(Is_NotMD5 "$(basename "${file}")")" || test -d "${file}"; then
-				files_notdanbooru="${files_notdanbooru}
-$(basename "${file}")"
-				has_err_filename=1
-			else
-				if test "$(${MD5} "${file}" | cut -d ' ' -f1 -)" = "$(basename "${file}" | cut -d '.' -f1)"; then
-					echo "$(basename "${file}")" >> "${TEMP_PREFIX}-ok"
+			if test "${file}" != "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}/*"; then
+				if test -n "$(Is_NotMD5 "$(basename "${file}")")" || test -d "${file}"; then
+					files_notdanbooru="${files_notdanbooru}
+	$(basename "${file}")"
+					has_err_filename=1
 				else
-					rm "${file}" || Err_Fatal "Error removing ${file}"
-					echo "$(basename "${file}")" >> "${TEMP_PREFIX}-error"
-					files_error="${files_error}
-$(basename "${file}")"
-					has_err_md5=1
+					if test "$(${MD5} "${file}" | cut -d ' ' -f1 -)" = "$(basename "${file}" | cut -d '.' -f1)"; then
+						echo "$(basename "${file}")" >> "${TEMP_PREFIX}-ok"
+					else
+						rm "${file}" || Err_Fatal "Error removing ${file}"
+						echo "$(basename "${file}")" >> "${TEMP_PREFIX}-error"
+						files_error="${files_error}
+	$(basename "${file}")"
+						has_err_md5=1
+					fi
 				fi
 			fi
 			Progress_Anim