Skip to content

Instantly share code, notes, and snippets.

@saxbophone
Created August 28, 2015 20:58
Show Gist options
  • Save saxbophone/e578bd93221e74939c14 to your computer and use it in GitHub Desktop.
Save saxbophone/e578bd93221e74939c14 to your computer and use it in GitHub Desktop.
Minecraft Server Bootstrap
#!/usr/bin/env bash
###########################################################################
# #
# MINESTRAPS - A no-shit bootstrap script for Minecraft on Amazon Linux #
# Written By Joshua Saxby 2015 #
# #
###########################################################################
# Initialise config variables
export MINECRAFT_USER='minecraft';
export SERVER_VERSION='1.7.2';
export BASE_URL='https://s3.amazonaws.com/Minecraft.Download/versions';
export FULL_URL="${BASE_URL}/${SERVER_VERSION}/minecraft_server.${SERVER_VERSION}.jar";
echo $FULL_URL;
# First Update System Packages (assumes yes to any questions asked)
sudo yum update -y;
# Create the minecraft system user
sudo adduser $MINECRAFT_USER;
# Rest of the commands get run as the newly created minecraft user
sudo su $MINECRAFT_USER << EOF
# Go to home directory
cd;
# Download the desired minecraft version
wget $FULL_URL;
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment