Menu

Script to update server to new version?

2020-06-01
2020-06-14
  • Timo Sivula

    Timo Sivula - 2020-06-01

    Some time ago someone here in the forum published a script that updated Jamulus on linux by pulling the next version from the web, compiled it and installed it. I can not find it anymore. Could someone point me to the script?

     
  • punshon

    punshon - 2020-06-01

    Hi Timo,

    I never saw the script you mention.

    But how about this

    #!/bin/bash
    cd src/jamulus
    git pull
    make
    sudo systemctl stop jamulus
    sudo cp Jamulus /usr/local/bin/Jamulus
    sudo systemctl start jamulus
    

    Scheduled like this:

    0 5 * * 1 /home/ubuntu/update-jamulus.sh
    
     
    👍
    1
    • Timo Sivula

      Timo Sivula - 2020-06-12

      Thanks, this was better than the original.

       
    • Gilgongo

      Gilgongo - 2020-06-14

      Interestingly, this doesn't work on the Jamulus repo. Not sure why not:

      https://api.github.com/repos/corrados/jamulus/releases/latest

       
  • Gilgongo

    Gilgongo - 2020-06-14

    This is the script I use. You need to give it the release number in the format n_n_n (as per the Github release page). It could be improved of course (eg preventing upgrade if there are people on the server, or getting the latest release without you having to specify that).

    #!/bin/bash -e
    
    ### path to Jamulus ###
    p=/usr/local/bin/Jamulus
    
    ### Check if it does not exist ###
    if [ ! -f $p ] 
    then
        echo "$p DOES NOT exist. Quitting." 
        exit 0
    fi
    
    # Remove any previous downloads
    rm -rf /tmp/jamulus-r*
    
    echo ""
    echo "Stopping server..."
    echo ""
    sudo service jamulus stop
    
    cd /tmp
    wget https://github.com/corrados/jamulus/archive/r$1.tar.gz
    tar -xvf r$1.tar.gz
    cd /tmp/jamulus-r$1
    
    qmake "CONFIG+=nosound" Jamulus.pro
    make clean
    make
    
    sudo mv $p $p.old
    sudo mv /tmp/jamulus-r$1/Jamulus $p
    
    echo ""
    echo "Starting server..."
    echo ""
    sudo service jamulus start
    
    rm -rf /tmp/jamulus-r$1*
    
    echo ""
    echo "Jamulus now upgraded."
    
    exit 0
    
     
MongoDB Logo MongoDB