From d8b6eb38672505d5169dbdb463180f6da8740441 Mon Sep 17 00:00:00 2001 From: nachoparker Date: Thu, 26 Oct 2017 12:17:28 +0200 Subject: [PATCH] nc-notify-updates: fix repeated lines --- etc/nextcloudpi-config.d/nc-notify-updates.sh | 2 +- update.sh | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/etc/nextcloudpi-config.d/nc-notify-updates.sh b/etc/nextcloudpi-config.d/nc-notify-updates.sh index e85912ca0..f0a5428f7 100644 --- a/etc/nextcloudpi-config.d/nc-notify-updates.sh +++ b/etc/nextcloudpi-config.d/nc-notify-updates.sh @@ -96,7 +96,7 @@ test -e "\$STAMPFILE" || touch "\$STAMPFILE" [ \$( date -r "\$LOGFILE" +'%y%m%d%H%M' ) -le \$( date -r "\$STAMPFILE" +'%y%m%d%H%M' ) ] && { echo "info is up to date"; exit 0; } -LINE=\$( grep "INFO Packages that will be upgraded" "\$LOGFILE" ) +LINE=\$( grep "INFO Packages that will be upgraded" "\$LOGFILE" | tail -1 ) [[ "\$LINE" == "" ]] && { echo "no new upgrades"; touch "\$STAMPFILE"; exit 0; } diff --git a/update.sh b/update.sh index f28e07b80..83e51580f 100755 --- a/update.sh +++ b/update.sh @@ -176,6 +176,34 @@ EOF grep -q actionstop_ "$F" || sed -i 's|actionstop|actionstop_|' "$F" type whois &>/dev/null || { apt-get update; apt-get install --no-install-recommends -y whois; } + # fix notify unattended upgrades repeating lines + cat > /usr/local/bin/ncp-notify-unattended-upgrade <