If you need to download it, save the following link to a file:
http://shadowm2006.sitesled.com/src/normalize_filenames
Code:
Code: Select all
#!/bin/sh
## ------------------------------------------------------------------------------------
## normalize_filenames - Converts all filenames of a dir in a case-sensitive
## volume to what LModKeen expects
##
## Copyright (c)2007 by Ignacio R. Morelle "Shadow Master". (shadowm2006@gmail.com)
## for LModKeen II
##
## Original code Copyright (c)2002-2004 Andrew Durdin. (andy@durdin.net)
## Keen Dreams support added by MultiMANIA. (multimania@gmail.com)
## Linux port code, reviewed Keen Dreams support and FIN2BMP integration
## by Shadow Master.
##
## This software is provided 'as-is', without any express or implied warranty.
## In no event will the authors be held liable for any damages arising from
## the use of this software.
## Permission is granted to anyone to use this software for any purpose, including
## commercial applications, and to alter it and redistribute it freely, subject
## to the following restrictions:
## 1. The origin of this software must not be misrepresented; you must not
## claim that you wrote the original software. If you use this software in
## a product, an acknowledgment in the product documentation would be
## appreciated but is not required.
## 2. Altered source versions must be plainly marked as such, and must not be
## misrepresented as being the original software.
## 3. This notice may not be removed or altered from any source distribution.
## ------------------------------------------------------------------------------------
normalize_keen123 ()
{
if [ -e ./egagraph.ck$episode ]; then
mv ./egagraph.ck$episode ./EGAGRAPH.CK$episode
fi
if [ -e ./egalatch.ck$episode ]; then
mv ./egalatch.ck$episode ./EGALATCH.CK$episode
fi
if [ -e ./egasprit.ck$episode ]; then
mv ./egasprit.ck$episode ./EGASPRIT.CK$episode
fi
if [ -e ./finale.ck$episode ]; then
mv ./finale.ck$episode ./FINALE.CK$episode
fi
if [ -e ./sounds.ck$episode ]; then
mv ./sounds.ck$episode ./SOUNDS.CK$episode
fi
if [ -e ./preview2.ck1 ]; then
mv ./preview2.ck1 ./PREVIEW2.CK1
fi
if [ -e ./preview3.ck1 ]; then
mv ./preview3.ck1 ./PREVIEW3.CK1
fi
return 0
}
normalize_keen456 ()
{
if [ -e ./audio.ck$episode ]; then
mv ./audio.ck$episode ./AUDIO.CK$episode
fi
if [ -e ./config.ck$episode ]; then
mv ./config.ck$episode ./CONFIG.CK$episode
fi
if [ -e ./egagraph.ck$episode ]; then
mv ./egagraph.ck$episode ./EGAGRAPH.CK$episode
fi
if [ -e ./egahead.ck$episode ]; then
mv ./egahead.ck$episode ./EGAHEAD.CK$episode
fi
if [ -e ./gamemaps.ck$episode ]; then
mv ./gamemaps.ck$episode ./GAMEMAPS.CK$episode
fi
if [ $episode != 6 ]; then
exe_eganame="KEEN${episode}E.EXE"
exe_cganame="KEEN${episode}C.EXE"
exe_eganame_l="keen${episode}e.exe"
exe_cganame_l="keen${episode}c.exe"
else
exe_eganame="KEEN6.EXE"
exe_cganame="KEEN6C.EXE"
exe_eganame_l="keen6.exe"
exe_cganame_l="keen6c.exe"
fi
if [ -e ./$exe_eganame_l ]; then
mv ./$exe_eganame_l ./$exe_eganame
fi
if [ -e ./$exe_cganame_l ]; then
mv ./$exe_cganame_l ./$exe_cganame
fi
return 0
}
declare episode
if [[ "$1" = "-h" || "$1" = "--help" ]]; then
echo "Usage:"
echo " normalize_filenames [episode number]"
echo "Note: episode number is D for Keen Dreams."
exit 0
fi
if [[ "$1" = "1" || "$1" = "keen1" || "$1" = "KEEN1" ]]; then
episode=1
elif [[ "$1" = "2" || "$1" = "keen2" || "$1" = "KEEN2" ]]; then
episode=2
elif [[ "$1" = "3" || "$1" = "keen3" || "$1" = "KEEN3" ]]; then
episode=3
elif [[ "$1" = "4" || "$1" = "keen4" || "$1" = "KEEN4" ]]; then
episode=4
elif [[ "$1" = "5" || "$1" = "keen5" || "$1" = "KEEN5" ]]; then
episode=5
elif [[ "$1" = "6" || "$1" = "keen6" || "$1" = "KEEN6" ]]; then
episode=6
elif [[ "$1" = "D" || "$1" = "kdreams" || "$1" = "KDREAMS" || "$1" = "keend" || "$1" = "KEEND" ]]; then
episode=7
else
echo "No episode number given!"
exit -1
fi
case $episode in
1) normalize_keen123 ;;
2) normalize_keen123 ;;
3) normalize_keen123 ;;
4) normalize_keen456 ;;
5) normalize_keen456 ;;
6) normalize_keen456 ;;
esac
echo "Done! Now you can run ModKeen."