1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
#!/bin/sh
#
# Quake wrapper script. By Joey Hess <joeyh@master.debian.org>, GPL copyright.
# This is the default directory where the quake libraries are to be found.
# It can be overridden by the config file.
quakedir=/usr/share/games/quake
# Read config file.
if [ -f /etc/quake.conf ]; then
. /etc/quake.conf
fi
if [ ! -d ~/.quake ]; then
mkdir ~/.quake
fi
# Remove all old symlinks for .pak files in ~/.quake/ directory.
cd ~/.quake
find -type l -name \*.pak |xargs rm -f
# Make new symlinks for .pak files. (And handle uppercase .PAK files.)
cd $quakedir
files=`find -name \*.pak -o -name \*.PAK`
if [ "$files" ]; then
for file in $files ; do
oldfile=$file
file=`echo "$file" | tr A-Z a-z`
mkdir -p ~/.quake/`dirname $file`
ln -s "$quakedir/$oldfile" ~/.quake/$file
done
fi
# Remove any empty directories.
cd ~/.quake
find * -type d | xargs rmdir 2>/dev/null
# Not everyone has this in their PATH.
PATH=$PATH:/usr/games
exec squake.real $@
|