comparison moefetch.sh @ 222:e3fb9507cf7f

most bugs fixed now
author edhoprima@gmail.com <edhoprima@gmail.com>
date Thu, 02 Jul 2009 20:37:41 +0000
parents e891b563b797
children 04ad0b0a3c63
comparison
equal deleted inserted replaced
221:e891b563b797 222:e3fb9507cf7f
202 if test -d "${trash}" || test -n "$(Is_NotMD5 "$(basename "${trash}")")" || test -z "$(grep "$(basename "${trash}")" "${TEMP_PREFIX}-list")"; then 202 if test -d "${trash}" || test -n "$(Is_NotMD5 "$(basename "${trash}")")" || test -z "$(grep "$(basename "${trash}")" "${TEMP_PREFIX}-list")"; then
203 is_trash=1 203 is_trash=1
204 has_trash=1 204 has_trash=1
205 mv -f "${trash}" "${trash_dir}" || Err_Impossible 205 mv -f "${trash}" "${trash_dir}" || Err_Impossible
206 trashes="${trashes} 206 trashes="${trashes}
207 $(basename "${trash}")" 207 $(basename "${trash}")"
208 fi 208 fi
209 Progress_Anim 209 Progress_Anim
210 done 210 done
211 rmdir "${trash_dir}" 2>/dev/null 211 rmdir "${trash_dir}" 2>/dev/null
212 Progress_Done 212 Progress_Done
228 for file in "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}/"* 228 for file in "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}/"*
229 do 229 do
230 if test "${file}" != "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}/*"; then 230 if test "${file}" != "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}/*"; then
231 if test -n "$(Is_NotMD5 "$(basename "${file}")")" || test -d "${file}"; then 231 if test -n "$(Is_NotMD5 "$(basename "${file}")")" || test -d "${file}"; then
232 files_notdanbooru="${files_notdanbooru} 232 files_notdanbooru="${files_notdanbooru}
233 $(basename "${file}")" 233 $(basename "${file}")"
234 has_err_filename=1 234 has_err_filename=1
235 else 235 else
236 if test "$(${MD5} "${file}" | cut -d ' ' -f 1)" = "$(basename "${file}" | cut -d '.' -f 1)"; then 236 if test "$(${MD5} "${file}" | cut -d ' ' -f 1)" = "$(basename "${file}" | cut -d '.' -f 1)"; then
237 echo "$(basename "${file}")" >> "${TEMP_PREFIX}-ok" 237 echo "$(basename "${file}")" >> "${TEMP_PREFIX}-ok"
238 else 238 else
239 rm "${file}" || Err_Fatal "Error removing ${file}" 239 rm "${file}" || Err_Fatal "Error removing ${file}"
240 echo "$(basename "${file}")" >> "${TEMP_PREFIX}-error" 240 echo "$(basename "${file}")" >> "${TEMP_PREFIX}-error"
241 files_error="${files_error} 241 files_error="${files_error}
242 $(basename "${file}")" 242 $(basename "${file}")"
243 has_err_md5=1 243 has_err_md5=1
244 fi 244 fi
245 fi 245 fi
246 fi 246 fi
247 Progress_Anim 247 Progress_Anim