Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ncp-update « bin - github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3d21709fa6f8a035dc2c51f036e6e8db5c3b5654 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

# update latest NextCloudPi code from github

{
  [ $(id -u) -ne 0 ] && { printf "Must be run as root. Try 'sudo $0'\n"; exit 1; }
  ping  -W 2 -w 1 -q github.com &>/dev/null || { echo "No internet connectivity"; exit 1; }
  echo -e "Downloading updates"
  rm -rf /tmp/ncp-update-tmp
  git clone -q --depth 1 https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-update-tmp || exit 1
  cd /tmp/ncp-update-tmp

  echo -e "Performing updates"
  ./update.sh

  VER=$( git describe --always --tags )
  echo $VER > /usr/local/etc/ncp-version
  echo $VER > /var/run/.ncp-latest-version

  cd /
  rm -rf /tmp/ncp-update-tmp

  echo -e "NextCloudPi updated to version \e[1m$VER\e[0m"
  exit 
} # force to read the whole thing into memory, as its contents might change in update.sh