Results 1 to 4 of 4

Thread: Bash Script Help

  1. #1
    Join Date
    Mar 2011
    Location
    Indianapolis, IN
    Beans
    299
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Question Bash Script Help

    Hey all,

    I'm using an Arch Linux system for a small private Minecraft Server. I'm using custom MC Server software called Bukkit. I'm using the development builds, so there are frequent updates. Which means every time there's an update, I have to delete the old jar and download the new one. I decided to try to make a simple script that would automatically delete the old one and download the newer version. The problem is, I don't know how to make wget (or curl) check to see if there is a new version of the jar. The name of the jar itself doesn't change, but the directory it's under does. The builds are at http://dl.bukkit.org/downloads/craftbukkit. Can anyone help me with this? Thanks!

    Thomas
    I'm really looking forward to Ubuntu 13.04 Raring Ringtail! Are you?

  2. #2
    Join Date
    Jun 2005
    Location
    Toronto, Canada
    Beans
    Hidden!
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: Bash Script Help

    Moved to General Help.

  3. #3
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,790
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Bash Script Help

    Hi doppel.ganger.

    If I remember correctly, the jar file is not too big, so without putting too much thought on it, I think something like this would work:
    • Make an schedule to download regularly the jar (use crontab for instance).
    • Use the command 'diff' to compare them.
    • If they are different, it means it's new version, so you can replace the current one with the recently downloaded.

    Just a thought.
    Regards.

  4. #4
    Join Date
    Jul 2007
    Location
    Poland
    Beans
    4,499
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Bash Script Help

    Code:
    wget http://dl.bukkit.org$( wget -q -O- http://dl.bukkit.org/downloads/craftbukkit/ | grep -oE '/downloads/[^"]*-dev.jar' | head -1 )
    should download the latest *-dev version
    if your question is answered, mark the thread as [SOLVED]. Thx.
    To post code or command output, use [code] tags.
    Check your bash script here // BashFAQ // BashPitfalls

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •