2 # Initial version by Bioware
3 # Modified to match the gentoo setup
4 # 03/27/2003 phoen][x <phoenix@gentoo.org>
6 cd GENTOO_DIR/nwn || exit 1
8 aRequiredDirs=(ambient data music override miles nwm)
9 aRequiredFiles=(chitin.key dialog.tlk nwmain)
10 aLCDirs=(ambient data dmvault hak localvault music override portraits)
12 aWritables=(nwn.ini nwnplayer.ini nwncdkey.ini saves localvault tempclient currentgame dmvault)
14 printf "Checking for required files\n\n"
16 for d in ${aRequiredDirs[@]} ; do
18 printf "PASSED: $d directory exists\n"
20 printf "FAILED: $d directory missing\n"
25 for f in ${aRequiredFiles[@]} ; do
27 printf "PASSED: $f exists\n"
29 printf "FAILED: $f missing\n"
34 printf "\nFixing case\n\n"
36 if [[ -f dialog.TLK ]] ; then
37 mv dialog.TLK dialog.tlk
40 if [[ -f dialogF.TLK ]] ; then
41 mv dialogF.TLK dialogf.tlk
44 for d in ${aLCDirs[@]} ; do
49 for f in $(find . -name '*.*') ; do
50 lcf=$(echo $f | tr [:upper:] [:lower:])
51 if [[ $f != $lcf ]] && [[ -f $f ]] ; then
52 mv $f $(echo $f | tr [:upper:] [:lower:])
65 if [[ -d saves ]] ; then
67 for d in $(find . -name '* - *' -type d -printf "%f|") ; do
71 [[ -f Portrait.tga ]] && mv Portrait.tga portrait.tga
72 [[ -f Screen.tga ]] && mv Screen.tga screen.tga
81 printf "\nChecking for problem files\n\n"
83 for f in ${aProblemFiles[@]} ; do
85 printf "WARNING: $f exists, deleting this file is recommended\n"
89 printf "\nFixing permissions\n\n"
91 chown GENTOO_USER:GENTOO_GROUP GENTOO_DIR/nwn/ -R
92 chmod g+rwX GENTOO_DIR/nwn/ -R
94 # 1.65-specific fixes to permissions
95 [ -e GENTOO_DIR/nwn/data/patch.bif ] && \
96 chmod a-x GENTOO_DIR/nwn/data/patch.bif 2>&1 > /dev/null
97 chmod a-x GENTOO_DIR/nwn/nwm/Chapter1.nwm 2>&1 > /dev/null
98 chmod a-x GENTOO_DIR/nwn/nwm/Chapter1E.nwm 2>&1 > /dev/null
99 chmod a-x GENTOO_DIR/nwn/nwm/Chapter2.nwm 2>&1 > /dev/null
100 chmod a-x GENTOO_DIR/nwn/nwm/Chapter2E.nwm 2>&1 > /dev/null
101 chmod a-x GENTOO_DIR/nwn/nwm/Chapter3.nwm 2>&1 > /dev/null
102 chmod a-x GENTOO_DIR/nwn/nwm/Chapter4.nwm 2>&1 > /dev/null
103 chmod a-x GENTOO_DIR/nwn/nwm/Prelude.nwm 2>&1 > /dev/null
104 [ -e GENTOO_DIR/nwn/patch.key ] && \
105 chmod a-x GENTOO_DIR/nwn/patch.key 2>&1 > /dev/null
107 printf "\nYou are ready to run Neverwinter Nights.\n\n"