Skip to content

Instantly share code, notes, and snippets.

@resba
Created April 25, 2011 21:40
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save resba/941295 to your computer and use it in GitHub Desktop.
Save resba/941295 to your computer and use it in GitHub Desktop.
Install/Upgrade Minecraft Server Running CraftBukkit
#!/bin/bash
cburl="http://ci.bukkit.org/job/dev-CraftBukkit/Recommended/artifact/target/craftbukkit-0.0.1-SNAPSHOT.jar"
cbver="818"
# Script by resba
#
# Complete Install:
# Complete Install installs the Craftbukkit Server along with any and all peripherals such as java and screen needed to run the Server on Linux CentOS Machines. Comes with step-by-step server.properties installer.
#
# This Install is Tailored to CentOS 5 and is not guaranteed to work on other linux derivatives.
#
#
echo "Craftbukkit Install for CentOS 5 (COMPLETE INSTALL)"
echo "Script by Resba"
echo "This script will install the following:"
echo "- CraftBukkit Server Modification Version $cbver"
echo "- java-1.6.0-openjdk (install via yum)"
echo "- screen (install via yum)"
echo "Please make sure that you have sufficient system permissions to begin installation."
echo "Disclaimer: This script takes NO responsibility for any possible damage to this system or any system that installs the above items using this script. the script is provided on an AS-IS basis and comes with ZERO support from the creator. Use at your own risk."
echo ""
echo -n "By typing YES at the end of this line, you agree to install the above programs onto this machine and agree to the disclaimer. [yes/no]:"
read begin
if [ "$begin" == "yes" ]; then
echo -n "Where would you like to put the folder containing your server? [example: /home/USERNAME/mcserver]:"
read srvroot
mkdir "$srvroot"
cd "$srvroot"
echo "Now installing java-1.6.0-openjdk"
yum install java-1.6.0-openjdk
which java
echo -n "Above is the current location of your Java Installation [PRESS ENTER TO CONTINUE]"
read whichjava
echo "Now installing Craftbukkit Server Build $cbver"
wget "$cburl"
mv craftbukkit-0.0.1-SNAPSHOT.jar craftbukkit.jar
echo "Craftbukkit Build $cbver has been successfully installed!"
echo ""
echo "-----Setting up your server-----"
touch server.properties
chmod +rw server.properties
echo "# Minecraft server properties generated by Resba's Install Script for CentOS 5" >> server.properties
echo -n "What would you like to name your world file? (NO Spaces) [world]:"
read worldname
echo "levelname=$worldname" >> server.properties
echo -n "Is this World File going to be in the nether? [true/false]:"
read nethercheck
if [ "$nethercheck" == "true" ]; then
echo "hellworld=true" >> server.properties
else
echo "hellworld=false" >> server.properties
fi
echo -n "Will you allow Mobs to spawn? (Creepers, Skeletons, Spiders, etc. NOT ANIMALS.) [true/false]:"
read mobcheck
if [ "$mobcheck" == "true" ]; then
echo "spawn-monsters=true" >> server.properties
else
echo "spawn-monsters=false" >> server.properties
fi
echo "online-mode=true" >> server.properties
echo -n "Will you allow Animals to spawn? (Cows, Pigs, Wolves, etc.) [true/false]:"
read animalcheck
if [ "$animalcheck" == "true" ]; then
echo "spawn-animals=true" >> server.properties
else
echo "spawn-animals=false" >> server.properties
fi
echo -n "How many players will you allow on your server at once? [1-100]:"
read playercount
echo "max-players=$playercount" >> server.properties
echo -n "What is the IP Address of your server? If you don't know, just type localhost [example: 127.0.0.1]:"
read ip
echo "server-ip=$ip" >> server.properties
echo -n "Allow PvP? (Player vs Player Combat) [true/false]:"
read pvpcheck
if [ "$pvpcheck" == "true" ]; then
echo "pvp=true" >> server.properties
else
echo "pvp=false" >> server.properties
fi
echo -n "Enter the level seed you wish to use for your world (If you don't have one, make one up or just leave this blank.):"
read seed
echo "level-seed=$seed" >> server.properties
echo -n "Enter the port number you wish to use for the server (Note: It is recommended you use the default port number, 25565.) [25565]:"
read port
if [ "$port" == "" ]; then
echo "server-port=25565" >> server.properties
else
echo "server-port=$port" >> server.properties
fi
echo -n "Allow flight modifications on your server? [true/false]:"
read flight
if [ "$flight" == "true" ]; then
echo "allow-flight=true" >> server.properties
else
echo "allow-flight=false" >> server.properties
fi
echo -n "Whitelist your server? [true/false]:"
read whitelist
if [ "$whitelist" == "true" ]; then
echo "white-list=true" >> server.properties
else
echo "white-list=false" >> server.properties
fi
touch start.sh
chmod +rw start.sh
echo "#!/bin/bash" >> start.sh
echo "screen -dmS cbserver java -Xmx1024m -Xms1024m -jar crafbukkit.jar" >> start.sh
echo "Minecraft Server has been started." >> start.sh
echo "sleep 2" >> start.sh
touch stop.sh
chmod +rw stop.sh
echo "#!/bin/bash" >> stop.sh
echo "screen -S cbserver -p0 -X stuff \'stop\n\'" >> stop.sh
echo "Minecraft Server has been stopped." >> stop.sh
echo "sleep 3" >> stop.sh
echo "Craftbukkit Server Setup is now complete!"
echo "Installing screen"
yum install screen
echo "Screen Install Complete!"
echo "Setup is now complete and your minecraft server is ready to use!"
echo "Your server is located at $srvroot"
sleep 1
else
echo "You have disagreed to the Disclaimer and the script will now terminate. No changes have been made to your system."
fi
#!/bin/bash
cburl="http://ci.bukkit.org/job/dev-CraftBukkit/Recommended/artifact/target/craftbukkit-0.0.1-SNAPSHOT.jar"
cbver="818"
# Script by resba
#
# Full Install:
# Full Install installs the Craftbukkit Server only. Comes with step-by-step server.properties installer
#
# This Install is Tailored to CentOS 5 and is not guaranteed to work on other linux derivatives.
#
#
echo "Craftbukkit Install for CentOS 5 (FULL INSTALL)"
echo "Script by Resba"
echo "This script will install the following:"
echo "- CraftBukkit Server Modification Version $cbver"
echo ""
echo "System Prerequisites:"
echo "- java.1.6.X-openjdk"
echo "- screen"
echo "Please make sure that you have sufficient permissions to begin installation."
echo "Disclaimer: This script takes NO responsibility for any possible damage to this system or any system that installs the above items using this script. the script is provided on an AS-IS basis and comes with ZERO support from the creator. Use at your own risk."
echo ""
echo -n "By typing YES at the end of this line, you agree to install the above programs onto this machine and agree to the disclaimer. [yes/no]:"
read begin
if [ "$begin" == "yes" ]; then
echo -n "Where would you like to put the folder containing your server? [example: /home/USERNAME/mcserver]:"
read srvroot
mkdir "$srvroot"
cd "$srvroot"
which java
echo -n "Above is the current location of your Java Installation [PRESS ENTER TO CONTINUE]"
read whichjava
echo "Now installing Craftbukkit Build $cburl"
wget "$cburl"
mv craftbukkit-0.0.1-SNAPSHOT.jar minecraft_server.jar
echo "Craftbukkit Build $cbver has been successfully installed!"
echo ""
echo "-----Setting up your server-----"
touch server.properties
chmod +x server.properties
echo "# Minecraft server properties generated by Resba's Install Script for CentOS 5" >> server.properties
echo -n "What would you like to name your world file? (NO Spaces) [world]:"
read worldname
echo "levelname=$worldname" >> server.properties
echo -n "Is this World File going to be in the nether? (Press Enter for Default [False]) [true/false]:"
read nethercheck
if [ "$nethercheck" == "true" ]; then
echo "hellworld=true" >> server.properties
else
echo "hellworld=false" >> server.properties
fi
echo -n "Will you allow Mobs to spawn? (Creepers, Skeletons, Spiders, etc. NOT ANIMALS.)(Press Enter for Default) [true/false]:"
read mobcheck
if [ "$mobcheck" == "true" ]; then
echo "spawn-monsters=true" >> server.properties
else
echo "spawn-monsters=false" >> server.properties
fi
echo "online-mode=true" >> server.properties
echo -n "Will you allow Animals to spawn? (Cows, Pigs, Wolves, etc.)(Press Enter for Default) [true/false]:"
read animalcheck
if [ "$animalcheck" == "true" ]; then
echo "spawn-animals=true" >> server.properties
else
echo "spawn-animals=false" >> server.properties
fi
echo -n "How many players will you allow on your server at once? [1-100]:"
read playercount
echo "max-players=$playercount" >> server.properties
echo -n "What is the IP Address of your server? If you don't know, just type localhost [example: 127.0.0.1]:"
read ip
echo "server-ip=$ip" >> server.properties
echo -n "Allow PvP? (Player vs Player Combat)(Press Enter for Default) [true/false]:"
read pvpcheck
if [ "$pvpcheck" == "true" ]; then
echo "pvp=true" >> server.properties
else
echo "pvp=false" >> server.properties
fi
echo -n "Enter the level seed you wish to use for your world (If you don't have one, make one up or just leave this blank.):"
read seed
echo "level-seed=$seed" >> server.properties
echo -n "Enter the port number you wish to use for the server (Note: It is recommended you use the default port number, 25565.) [25565]:"
read port
if [ "$port" == "" ]; then
echo "server-port=25565" >> server.properties
else
echo "server-port=$port" >> server.properties
fi
echo -n "Allow flight modifications on your server? (Press Enter for Default) [true/false]:"
read flight
if [ "$flight" == "true" ]; then
echo "allow-flight=true" >> server.properties
else
echo "allow-flight=false" >> server.properties
fi
echo -n "Whitelist your server? (Press Enter for Default) [true/false]:"
read whitelist
if [ "$whitelist" == "true" ]; then
echo "white-list=true" >> server.properties
else
echo "white-list=false" >> server.properties
fi
touch start.sh
chmod +rw start.sh
echo "#!/bin/bash" >> start.sh
echo "screen -dmS cbserver java -Xmx1024m -Xms1024m -jar crafbukkit.jar" >> start.sh
echo "Minecraft Server has been started." >> start.sh
echo "sleep 2" >> start.sh
touch stop.sh
chmod +rw stop.sh
echo "#!/bin/bash" >> stop.sh
echo "screen -S cbserver -p0 -X stuff \'stop\n\'" >> stop.sh
echo "Minecraft Server has been stopped." >> stop.sh
echo "sleep 3" >> stop.sh
echo "Minecraft Server Setup is now complete!"
echo "Setup is now complete and your minecraft server is ready to use!"
sleep 1
else
echo "You have disagreed to the Disclaimer and the script will now terminate. No changes have been made to your system."
fi
#!/bin/bash
cburl="http://ci.bukkit.org/job/dev-CraftBukkit/Recommended/artifact/target/craftbukkit-0.0.1-SNAPSHOT.jar"
cbver="818"
# Script by resba
#
# Full Install:
# Full Install installs the Craftbukkit Server only. Comes with step-by-step server.properties installer
#
# This Install is Tailored to Mac OS X 10.x.x and is not guaranteed to work on linux/unix derivatives.
#
#
echo "Craftbukkit Install for Mac OS X 10.x.x (FULL INSTALL)"
echo "Script by Resba"
echo "This script will install the following:"
echo "- CraftBukkit Server Modification Version $cbver"
echo ""
echo "WARNING: You are installing Craftbukkit Build $cbver "
echo "Please make sure that you have sufficient permissions to begin installation."
echo "Disclaimer: This script takes NO responsibility for any possible damage to this system or any system that installs the above items using this script. the script is provided on an AS-IS basis and comes with ZERO support from the creator. Use at your own risk."
echo ""
echo -n "By typing YES at the end of this line, you agree to install the above programs onto this machine and agree to the disclaimer. [yes/no]:"
read begin
if [ "$begin" == "yes" ]; then
echo -n "Where would you like your server? (No Trailing Slash.) [example: /Users/YOURUSERNAME/mcserver]:"
read srvroot
mkdir "$srvroot"
cd "$srvroot"
which java
echo -n "Above is the current location of your Java Installation [PRESS ENTER TO CONTINUE]"
read whichjava
echo "Craftbukkit Build $cbver"
curl "$cburl" -o craftbukkit.jar
echo "Craftbukkit Build $cbver has been successfully installed!"
echo ""
echo "-----Setting up your server-----"
touch server.properties
chmod +x server.properties
echo "# Minecraft server properties generated by Resba's Install Script for Mac OS X 10.x.x" >> server.properties
echo -n "What would you like to name your world file? (NO Spaces) [world]:"
read worldname
echo "levelname=$worldname" >> server.properties
echo -n "Is this World File going to be in the nether? [true/false]:"
read nethercheck
if [ "$nethercheck" == "true" ]; then
echo "hellworld=true" >> server.properties
else
echo "hellworld=false" >> server.properties
fi
echo -n "Will you allow Mobs to spawn? (Creepers, Skeletons, Spiders, etc. NOT ANIMALS.)(Enter for Default) [true/false]:"
read mobcheck
if [ "$mobcheck" == "true" ]; then
echo "spawn-monsters=true" >> server.properties
else
echo "spawn-monsters=false" >> server.properties
fi
echo "online-mode=true" >> server.properties
echo -n "Will you allow Animals to spawn? (Cows, Pigs, Wolves, etc.) (Enter for Default) [true/false]:"
read animalcheck
if [ "$animalcheck" == "true" ]; then
echo "spawn-animals=true" >> server.properties
else
echo "spawn-animals=false" >> server.properties
fi
echo -n "How many players will you allow on your server at once? [1-100]:"
read playercount
echo "max-players=$playercount" >> server.properties
echo -n "What is the IP Address of your server? If you don't know, just type localhost [example: 127.0.0.1]:"
read ip
echo "server-ip=$ip" >> server.properties
echo -n "Allow PvP? (Player vs Player Combat) (Enter for Default) [true/false]:"
read pvpcheck
if [ "$pvpcheck" == "true" ]; then
echo "pvp=true" >> server.properties
else
echo "pvp=false" >> server.properties
fi
echo -n "Enter the level seed you wish to use for your world (If you don't have one, make one up or just leave this blank.):"
read seed
echo "level-seed=$seed" >> server.properties
echo -n "Enter the port number you wish to use for the server (Note: It is recommended you use the default port number, 25565.) (Enter for Default) [25565]:"
read port
if [ "$port" == "" ]; then
echo "server-port=25565" >> server.properties
else
echo "server-port=$port" >> server.properties
fi
echo -n "Allow flight modifications on your server? (Enter for Default) [true/false]:"
read flight
if [ "$flight" == "true" ]; then
echo "allow-flight=true" >> server.properties
else
echo "allow-flight=false" >> server.properties
fi
echo -n "Whitelist your server? [true/false]:"
read whitelist
if [ "$whitelist" == "true" ]; then
echo "white-list=true" >> server.properties
else
echo "white-list=false" >> server.properties
fi
touch start.sh
chmod +rw start.sh
echo "#!/bin/bash" >> start.sh
echo "screen -dmS cbserver java -Xmx1024m -Xms1024m -jar crafbukkit.jar" >> start.sh
echo "Minecraft Server has been started." >> start.sh
echo "sleep 2" >> start.sh
touch stop.sh
chmod +rw stop.sh
echo "#!/bin/bash" >> stop.sh
echo "screen -S cbserver -p0 -X stuff \'stop\n\'" >> stop.sh
echo "Minecraft Server has been stopped." >> stop.sh
echo "sleep 3" >> stop.sh
echo "Minecraft Server Setup is now complete!"
echo "Setup is now complete and your minecraft server is ready to use!"
sleep 1
else
echo "You have disagreed to the Disclaimer and the script will now terminate. No changes have been made to your system."
fi
#!/bin/bash
cburl="http://ci.bukkit.org/job/dev-CraftBukkit/Recommended/artifact/target/craftbukkit-0.0.1-SNAPSHOT.jar"
cbver="818"
# Script by resba
#
# Upgrade Craftbukkit build $cbver:
#
#
# This Upgrade is Tailored to CentOS 5 and is not guaranteed to work on other linux derivatives.
#
#
echo "Craftbukkit Install for CentOS 5 (UPGRADE TO CB$cbver)"
echo "Script by Resba"
echo "This script will install the following:"
echo "- CraftBukkit Server Modification Version $cbver"
echo ""
echo "System Prerequisites:"
echo "- java.1.6.X-openjdk"
echo "- screen"
echo "- CraftBukkit Server Modification Version Any"
echo "NOTICE: If your system does not meet these prerequisites, please use the COMPLETE or FULL INSTALL scripts."
echo ""
echo "WARNING: You are installing Craftbukkit Build $cbver"
echo "Please make sure that you have sufficient permissions to begin installation."
echo "Disclaimer: This script takes NO responsibility for any possible damage to this system or any system that installs the above items using this script. the script is provided on an AS-IS basis and comes with ZERO support from the creator. Use at your own risk."
echo ""
echo -n "By typing YES at the end of this line, you agree to install the above programs onto this machine and agree to the disclaimer. [yes/no]:"
read begin
if [ "$begin" == "yes" ]; then
echo -n "Where is your Minecraft Server Files Located? (Directory MUST exist. No Trailing Slash.) [example: /home/YOURUSERNAME/mcserver]:"
read srvroot
cd "$srvroot"
which java
echo -n "Above is the current location of your Java Installation [PRESS ENTER TO CONTINUE]"
read whichjava
echo "Craftbukkit Build $cbver"
wget "$cburl"
mv craftbukkit-0.0.1-SNAPSHOT.jar minecraft_server.jar
echo "Craftbukkit Build $cbver has been successfully installed!"
echo "Craftbukkit Server Setup is now complete!"
sleep 2
else
echo "You have disagreed to the Disclaimer and the script will now terminate. No changes have been made to your system."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment