Announcement

Collapse
No announcement yet.

NXCloud Update Script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • NXCloud Update Script

    Jahatech - I see that you've setup a Current Version php responder on the website for nxfilter = https://nxfilter.org/curver.php. As everything else in the update script for nxfilter should work for nxcloud - could we get a curver.php for nxcloud too?

    Thanks!

  • #2
    There's https://nxfilter.org/curnxc.php for NxCloud.

    Comment


    • #3
      Thank you, works beautifully. If anyone else is looking for the code:

      Code:
      !/bin/bash
      
      # Find out the latest version.
      CURVER=$( /usr/bin/curl -s https://nxfilter.org/curnxc.php )
      OLDVER=$( /usr/bin/dpkg -s nxcloud | /bin/grep Version | /usr/bin/awk {'print $2'} )
      
      if [ -z "$OLDVER" ]
      then
        echo "Can't find NxCloud installation to update."
        exit 0
      fi
      
      if [ $OLDVER = $CURVER ]; then
        echo "It's already up to date."
        exit 0
      fi
      
      # Downloading the latest version.
      FILENAME=nxcloud-${CURVER}.deb
      if [ ! -f $FILENAME ]
      then
        echo ""
        echo "### Trying to download NxCloud v${CURVER}."
        curl -O http://pub.nxfilter.org/$FILENAME
      fi
      
      if [ -f /nxcloud/nxd.jar ]
      then
        sudo systemctl stop nxcloud
      fi
      
      sleep 1
      echo ""
      echo "### Trying to install NxCloud v${CURVER}."
      sudo dpkg -i nxcloud-${CURVER}.deb
      
      sleep 1
      echo ""
      echo "### Starting NxCloud."
      sudo systemctl enable nxcloud
      sudo systemctl start nxcloud
      
      sleep 1
      echo ""
      SERVER_IP=$( /bin/hostname -I | awk '{print $1}' )
      echo "#####################################################################"
      echo "Your admin GUI URL is http://<serverIP/FQDN>/admin"
      echo "It may take some time for NxCloud to finish its update process."
      echo "You can monitor its startup process with the following command."
      echo "tail -f /nxcloud/log/nxcloud.log"
      echo "#####################################################################"

      Comment

      Working...
      X