5f019de
#!/bin/bash
5f019de
5f019de
set -e
5f019de
5f019de
if [ ! -f ~/.vavoom/heretic-shareware/heretic1.wad ]; then
5f019de
  set +e
5f019de
  /usr/share/autodl/AutoDL.py /usr/share/vavoom/heretic.autodlrc
5f019de
  STATUS=$?
5f019de
  set -e
5f019de
  # status 2 means download was ok, but the user choice not to start the game
5f019de
  if [ "$STATUS" = "0" -o  "$STATUS" = "2" ]; then
5f019de
    cd ~/.vavoom/heretic-shareware
5f019de
    unzip -u htic_v12.zip 'HTIC_V12.?'
5f019de
    cat HTIC_V12.1 HTIC_V12.2 > heretic.zip
5f019de
    unzip -u -L heretic.zip heretic1.wad
5f019de
    rm htic_v12.zip HTIC_V12.1 HTIC_V12.2 heretic.zip
5f019de
  fi
5f019de
  if [ "$STATUS" != "0" ]; then
5f019de
    exit $STATUS
5f019de
  fi
5f019de
fi
5f019de
5f019de
exec /usr/bin/vavoom -iwaddir ~/.vavoom/heretic-shareware -heretic "$@"