313886d
#!/bin/bash
313886d
313886d
set -e
313886d
313886d
. /usr/share/opengl-games-utils/opengl-game-functions.sh
313886d
313886d
checkDriOK quake3
313886d
313886d
if [ ! -f $HOME/.q3a/baseq3/pak0.pk3 ]; then
313886d
  set +e
313886d
  /usr/share/autodl/AutoDL.py /usr/share/quake3/quake3.autodlrc
313886d
  STATUS=$?
313886d
  set -e
313886d
  # status 2 means download was ok, but the user choice not to start the game
313886d
  if [ "$STATUS" = "0" -o "$STATUS" = "2" ]; then
313886d
    cd ~/.q3a
cf3d6e0
    unzip -qq -o -u quake3-latest-pk3s.zip
313886d
    tail -n +165 linuxq3ademo-1.11-6.x86.gz.sh | gzip -d -c | \
313886d
      tar x demoq3/pak0.pk3
313886d
    # remove any old versions (if present) otherwise the mv fails
313886d
    rm -fr baseq3 missionpack
313886d
    mv quake3-latest-pk3s/* .
313886d
    mv demoq3/pak0.pk3 baseq3
313886d
    rm quake3-latest-pk3s.zip linuxq3ademo-1.11-6.x86.gz.sh
313886d
    rmdir quake3-latest-pk3s demoq3
313886d
  fi
313886d
  if [ "$STATUS" != "0" ]; then
313886d
    exit $STATUS
313886d
  fi
313886d
fi
313886d
313886d
exec quake3 "$@"