~mbruzek/charms/precise/minecraft/tests

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

## https://gist.github.com/1336585

juju-log "Installing OpenJDK"
apt-get install -y openjdk-6-jre

juju-log "Add Minecraft init script" 
cp opt/minecraft /etc/init/minecraft.conf

juju-log "Downloading Minecraft"
mkdir -p /opt/minecraft/
wget "https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.jar" -O /opt/minecraft/minecraft_server.jar

juju-log "Branching Minecraft Checksum"
bzr branch lp:~marcoceppi/charm/oneiric/minecraft/checksum

md5sum -c  checksum/checksums
if [ "$?" -ne 0 ]; then
	juju-log "Checksum conditions failed! Exiting"
	exit 2 #Checksum error number, I just made it up for this.
fi