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

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

# update latest available version in /var/run/.ncp-latest-version

[ $(id -u) -ne 0 ] && exit 1

ping  -W 2 -w 1 -q github.com &>/dev/null || { echo "No internet connectivity"; exit 1; }

git clone --depth 20 -q --bare https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-check-tmp || exit 1

cd /tmp/ncp-check-tmp
VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" )
grep -qP "v\d+\.\d+\.\d+" <<< $VER && {       # check format
  echo $VER > /var/run/.ncp-latest-version
}
cd /

rm -rf /tmp/ncp-check-tmp