#!/bin/bash

set -eux # -x for verbose logging to juju debug-log

## Using headless to avoid installing X server ;)
apt-get -y install openjdk-7-jre-headless

## For tectonicus
#apt-get -y install subversion

INSTALL_DIR=/opt/apps/minecraft

mkdir -p $INSTALL_DIR
wget https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.jar -O $INSTALL_DIR/minecraft_server.jar


cp etc/init/minecraft.conf /etc/init/minecraft.conf