mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-10 15:12:01 -03:30
19 lines
557 B
Bash
Executable File
19 lines
557 B
Bash
Executable File
#!/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 || exit 1
|
|
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 / || exit 1
|
|
|
|
rm -rf /tmp/ncp-check-tmp
|