Advertisement
phillips321

photo_thumbCheckExist.sh

May 9th, 2011
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.87 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # ce script verifie si l'image cible a deja des miniatures
  4.  
  5. # input
  6. picDir=$1
  7. picName=$2
  8.  
  9. # fichiers temporaires
  10. fileTmpLs="/tmp/thbExist918ls"
  11. fileTmpRef="/tmp/thbExist918ref"
  12. fileTmpDiff="/tmp/thbExist918diff"
  13.  
  14.  
  15. # reference "ls"
  16. echo "SYNOPHOTO:THUMB_B.jpg" > $fileTmpRef
  17. echo "SYNOPHOTO:THUMB_L.jpg" >> $fileTmpRef
  18. echo "SYNOPHOTO:THUMB_M.jpg" >> $fileTmpRef
  19. echo "SYNOPHOTO:THUMB_S.jpg" >> $fileTmpRef
  20. echo "SYNOPHOTO:THUMB_XL.jpg">> $fileTmpRef
  21.  
  22. # "ls" cible
  23. if [[ -d "$picDir/@eaDir/$picName" ]]
  24. then
  25.   # echo "existe!"
  26.  
  27.   # verifie si les fichiers thumb existe bien tous
  28.   ls "$picDir""/@eaDir/""$picName" > $fileTmpLs
  29.   diff $fileTmpLs $fileTmpRef > $fileTmpDiff
  30.  
  31.   # else
  32.   # echo "n'existe pas"
  33.  
  34. else
  35.  
  36.   # met n'importe quoi pour dans le diff pour dire que รงa differe
  37.   echo "n'existe pas donc a creer" > $fileTmpDiff
  38. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement