-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cron scripts, sample startup script, and user_data placeholder text
- Loading branch information
Showing
4 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
# Associate EIP if it's dangling | ||
output=`aws ec2 describe-addresses --public-ip=127.0.0.1 | grep InstanceId` | ||
output=${output/#*InstanceId\": /} | ||
output=${output/%\",*/} | ||
|
||
if [ "$output" = "\"" ] | ||
then | ||
now=$(date +"%Y-%m-%d %T") | ||
echo "$now - Snagging EIP" | ||
myID=`curl -s http://169.254.169.254/latest/meta-data/instance-id` | ||
`/usr/local/bin/aws ec2 associate-address --instance-id $myID --public-ip 127.0.0.1` | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
output=`screen -ls | grep overviewer` | ||
if [ ${#output} = 0 ] | ||
then | ||
screen -S overviewer -d -m overviewer.py --config=/mnt/overviewer/config.py | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash -ex | ||
dpkg-reconfigure -f noninteractive tzdata | ||
apt-get install -q -y openjdk-7-jre ntp nginx | ||
|
||
cat <<EOF >/etc/rc.local | ||
cd /home/minecraft | ||
su minecraft -c "screen -S minecraft -d -m /usr/bin/java -Xms768M -Xmx1G -jar minecraft_server.jar nogui >> server.log" | ||
EOF | ||
chmod +x /etc/rc.local | ||
sh /etc/rc.local | ||
|
||
echo "deb http://overviewer.org/debian ./" >> /etc/apt/sources.list | ||
apt-get update | ||
apt-get install minecraft-overviewer -y --force-yes | ||
|
||
wget -N http://s3.amazonaws.com/MinecraftDownload/minecraft.jar -P /home/minecraft/.minecraft/bin/ | ||
|
||
mkdir /mnt/overviewer | ||
cp /home/minecraft/overviewer/config.py /mnt/overviewer/config.py | ||
chown minecraft:minecraft /mnt/overviewer -R | ||
|
||
su minecraft -c "screen -S overviewer -d -m overviewer.py --config=/mnt/overviewer/config.py" | ||
|
||
cp /home/minecraft/overviewer/map_update /mnt/overviewer/map_update | ||
chown minecraft:minecraft /mnt/overviewer/map_update | ||
cp /home/minecraft/overviewer/crontab /etc/cron.d/minecraft | ||
|
||
cp /home/minecraft/overviewer/site-profile /etc/nginx/sites-available/minecraft | ||
|
||
rm /etc/nginx/sites-enabled/default | ||
ln -s /etc/nginx/sites-available/minecraft /etc/nginx/sites-enabled/minecraft | ||
service nginx start |