nextcloudpi/bin/ncp-check-version
2017-06-06 07:19:16 +02:00

16 lines
413 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 -q --depth 1 https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-check-tmp || exit 1
cd /tmp/ncp-check-tmp
git describe --always --tags > /var/run/.ncp-latest-version
cd /
rm -rf /tmp/ncp-check-tmp