Advertisement
Guest User

Dredmor linux case fix

a guest
Jan 15th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. #!/bin/bash
  2. # Dungeons of Dredmor case insensitive file referencing fix
  3.  
  4. if [ ! -f game/monDB.xml ]
  5. then
  6. echo Didn\'t find \"game/monDB.xml\". Run script from same directory as Dredmor-amd64 and Dredmor-x86
  7. exit 1
  8. fi
  9.  
  10. ERROR=0
  11.  
  12. for FILE in `grep sprites game/monDB.xml | awk -F\" '{print $2}'`
  13. do
  14. # file referenced in xml, lets try to do something about that
  15. if [ ! -f $FILE ]
  16. then
  17. ACTUAL=$(find . -iwholename ./$FILE)
  18. ACTUAL=${ACTUAL:2}
  19. #if found correct case of existing file then fix xml file with that info
  20. if [ -n "$ACTUAL" ]
  21. then
  22. echo $FILE -\> $ACTUAL
  23. sed -i "s|$FILE|$ACTUAL|g" game/monDB.xml
  24. else
  25. echo WARNING $FILE referenced by monDB.xml doesnt exist
  26. fi
  27. ERROR=1
  28. fi
  29. done
  30.  
  31. if [ $ERROR -eq 0 ]
  32. then
  33. echo Congratulations your monDB.xml seems to be case aware
  34. else
  35. echo
  36. echo Changed monDB.xml entries on the left to their real names on the right
  37. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement