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

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

# notify latest available NC version

set -e

source /usr/local/etc/library.sh # sets NCLATESTVER

CURRENT="$(ncc status | grep "version:" | awk '{ print $3 }')"
LATEST="$(wget -qO- https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/etc/ncp.cfg | jq -r .nextcloud_version)"
NOTIFIED=/var/run/.nc-version-notified

test -e "${NOTIFIED}" && [[ "${LATEST}" == "$( cat "${NOTIFIED}" )" ]] && {
  echo "Found update from ${CURRENT} to ${LATEST}. Already notified"
  exit 0
}

if is_more_recent_than "${LATEST}" "${CURRENT}"; then
  notify_admin \
    "Nextcloud update" \
    "Update from ${CURRENT} to ${LATEST} is available. Update from https://$(get_ip):4443"
  echo "${LATEST}" > "${NOTIFIED}"
fi