5f019de
#!/bin/bash
5f019de
5f019de
set -e
5f019de
5f019de
if [ ! -f ~/.vavoom/hexen-demo/hexen.wad ]; then
5f019de
  set +e
5f019de
  /usr/share/autodl/AutoDL.py /usr/share/vavoom/hexen.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/hexen-demo
5f019de
    unzip -u -L hexndemo.zip hexen.wad
5f019de
    rm hexndemo.zip
5f019de
  fi
5f019de
  if [ "$STATUS" != "0" ]; then
5f019de
    exit $STATUS
5f019de
  fi
5f019de
fi
5f019de
5f019de
exec /usr/bin/vavoom -iwaddir ~/.vavoom/hexen-demo -hexen "$@"