diff options
Diffstat (limited to 'bin/ncp-update')
-rwxr-xr-x | bin/ncp-update | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/ncp-update b/bin/ncp-update index 3d21709f..8330cf06 100755 --- a/bin/ncp-update +++ b/bin/ncp-update @@ -7,15 +7,17 @@ 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 + git clone -q 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 + VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" ) + grep -qP "v\d+\.\d+\.\d+" <<< $VER && { # check format + echo $VER > /usr/local/etc/ncp-version + echo $VER > /var/run/.ncp-latest-version + } cd / rm -rf /tmp/ncp-update-tmp |