Skip to content

Instantly share code, notes, and snippets.

@fernferret
Created December 10, 2011 17:55
Show Gist options
  • Save fernferret/1455756 to your computer and use it in GitHub Desktop.
Save fernferret/1455756 to your computer and use it in GitHub Desktop.
Bukkit Updater Script
#!/bin/bash
ver="stable"
build="-1"
if [ -z $1 ] ; then
echo "Updating to latest STABLE build."
else
ver="dev"
echo "Updating to latest DEV build."
fi
if [ -z $2 ] ; then
echo "Updating to the latest"
else
echo "Updating to bukkit $2"
ver="dev"
build=$2
fi
if [ ! -d incoming ] ; then
mkdir incoming
else
rm -rf incoming
mkdir incoming
fi
cd incoming
if [[ $ver == "dev" ]] ; then
if [ -z $build ] || [[ $build == "-1" ]] ; then
wget -N http://ci.bukkit.org/job/dev-CraftBukkit/lastSuccessfulBuild/artifact/*zip*/archive.zip
else
wget -N "http://ci.bukkit.org/job/dev-CraftBukkit/$build/artifact/*zip*/archive.zip"
fi
else
wget -N http://ci.bukkit.org/job/dev-CraftBukkit/Recommended/artifact/*zip*/archive.zip
fi
unzip archive.zip
cd archive/target/
mv *.jar ../../../craftbukkit.jar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment