Static URL for CraftBukkit JAR

Discussion in 'Bukkit Help' started by Clontarf[X], Jan 20, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Clontarf[X]

    Hi Guys,

    Just an idea, is there a static URL that you guys could specify for future updates to the craftbukkit jar? The reason I ask is I imagine there's quite a few server operators like myself who use an autoupdating script (I wrote my own), which use wget or similar to download the latest .jar available.

    Are there any plans to have all future releases accessible by a static URL? That would be a pretty awesome tool for those of us who love to write scripts.

    Cheers
     
  2. Offline

    ShivalWolf

    It already is static

    http://artifacts.lukegb.com/artifac...0.0.1-SNAPSHOT/craftbukkit-0.0.1-SNAPSHOT.jar

    Also this is my update script for linux. This is an extract of my init script from an earlier post.
    Code:
    #!/bin/bash
    ## Update options
    UPDATE_MD5="http://artifacts.lukegb.com/artifactory/plugins-snapshot/org/bukkit/craftbukkit/0.0.1-SNAPSHOT/craftbukkit-0.0.1-SNAPSHOT.jar.md5"  #the download path for the md5 file
    UPDATE_FILE="http://artifacts.lukegb.com/artifactory/plugins-snapshot/org/bukkit/craftbukkit/0.0.1-SNAPSHOT/craftbukkit-0.0.1-SNAPSHOT.jar"     #the download path for the main server jar file
    UPDATE_BUILD_INFO="http://artifacts.lukegb.com/artifactory/plugins-snapshot/org/bukkit/craftbukkit/0.0.1-SNAPSHOT:maven-metadata.xml"   #the build info file
    GAME_FILE="craftbukkit"         #the filename to store the mod ass (i just use craftbukkit and remove the version"
    GAMEPATH='/var/games/mc-1'
     
    service_update() {
            echo "Stopping and Clearing all Service files."
            echo "Downloading latest md5"
            wget -q -O $GAMEPATH/NEW-$GAME_FILE.md5 $UPDATE_MD5
            if [ $? -eq 0 ]; then
                    NEW_MD5=`cat $GAMEPATH/NEW-$GAME_FILE.md5`
                    echo "New MD5: $NEW_MD5"
                    if [ -f $GAMEPATH/$GAME_FILE.md5 ]; then
                            OLD_MD5=`cat $GAMEPATH/$GAME_FILE.md5`
                            echo "LAST MD5: $OLD_MD5"
                            if [ "$OLD_MD5" == "$NEW_MD5" ]; then
                                    echo "No new update"
                                    exit 0
                            fi
                    fi
                    echo "Downloading new update file"
                    wget -q -O $GAMEPATH/$GAME_FILE.tmp $UPDATE_FILE
                    if [ $? -eq 0 ]; then
                            echo "File downloaded successfully"
                            NEW_FILE_MD5=`md5sum $GAMEPATH/$GAME_FILE.tmp | awk '{print $1}'`
                            if [ "$NEW_FILE_MD5" == "$NEW_MD5" ]; then
                                    echo "Update file valid Stopping server and copying file over"
                                    service_stop
                                    service_clear
                                    sleep 2
                                    service_start
                                    mv -f $GAMEPATH/$GAME_FILE.tmp $GAMEPATH/bin/$GAME_FILE.jar
                                    mv -f $GAMEPATH/NEW-$GAME_FILE.md5 $GAMEPATH/$GAME_FILE.md5
                                    rm -f $GAMEPATH/$GAME_FILE-buildinfo.xml
                                    wget -q -O $GAMEPATH/$GAME_FILE-buildinfo.xml $UPDATE_BUILD_INFO
                                    echo "BUILD INFO:"
                                    cat $GAMEPATH/$GAME_FILE-buildinfo.xml
                            fi
                    else
                            echo "File Download Failed"
                            rm $GAMEPATH/$GAME_FILE.tmp
                            rm $GAMEPATH/$GAME_FILE.md5
                    fi
            else
                    echo "MD5 download failed unable to check for new update"
            fi
    }
    
     
  3. Offline

    Clontarf[X]

    I am pretty certain that URL won't remain the same for the entire development of craftbukkit. That's kinda what was getting at, the long-term solution ;). Unless of course the developers integrate an auto-update feature, in which case this suggestion is moot :)
     
  4. Offline

    ShivalWolf

    I think there was a previous post about that possibility same with the whole plugin management thingie.
     
Thread Status:
Not open for further replies.

Share This Page