#!/bin/bash
[ `id -u` = 0 ] && { echo "do not run this as root!"; exit 1; }
sudo bash <<'End' || { echo "fail"; exit 1; }
echo >/etc/apt/sources.list.d/ppa_ubuntu-wine_ppa.list \
  "deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu lucid main"
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F9CB8DB0
apt-get update
dpkg --get-selections | awk '$2 == "install" {print $1}' | grep -e '^wine-' -e '^libwine' | xargs dpkg --force-depends -r
apt-get -f --install-recommends install
apt-get --install-recommends install wine 'wine1.5|wine1.4|wine1.3' winetricks || exit 1
End
echo
echo "installed wine okay"
read -n 1 -p "test? [yn] " yn
[[ "$yn" == [yY] ]] || exit
wget http://ai.ki/hexagon -O hexagon.zip && unzip hexagon.zip && rm hexagon.zip && exec wine hexagon.exe
