diff options
author | nachoparker <nacho@ownyourbits.com> | 2019-05-28 02:56:45 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2019-05-28 02:56:48 +0300 |
commit | c71b37f2b76dac1b25a94f3a63adaa291f4a0a55 (patch) | |
tree | 37660e3de0aa756283ef6d14e2956361974870a7 /bin/ncp | |
parent | bfdc47548e2b89998b577b8e98235d760b95e35d (diff) |
ncp-notify-updates: dont spam cron mailv1.12.9
Signed-off-by: nachoparker <nacho@ownyourbits.com>
Diffstat (limited to 'bin/ncp')
-rw-r--r-- | bin/ncp/CONFIG/nc-scan-auto.sh | 4 | ||||
-rw-r--r-- | bin/ncp/UPDATES/nc-notify-updates.sh | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/bin/ncp/CONFIG/nc-scan-auto.sh b/bin/ncp/CONFIG/nc-scan-auto.sh index 1445d7fc..1e15200d 100644 --- a/bin/ncp/CONFIG/nc-scan-auto.sh +++ b/bin/ncp/CONFIG/nc-scan-auto.sh @@ -10,9 +10,9 @@ -configure() +configure() { - [[ $ACTIVE != "yes" ]] && { + [[ $ACTIVE != "yes" ]] && { rm -f /etc/cron.d/ncp-scan-auto service cron restart echo "automatic scans disabled" diff --git a/bin/ncp/UPDATES/nc-notify-updates.sh b/bin/ncp/UPDATES/nc-notify-updates.sh index 08dd86ae..4155ae9f 100644 --- a/bin/ncp/UPDATES/nc-notify-updates.sh +++ b/bin/ncp/UPDATES/nc-notify-updates.sh @@ -33,8 +33,8 @@ NOTIFIED=/var/run/.ncp-version-notified test -e \$LATEST || exit 0; /usr/local/bin/ncp-test-updates || { echo "NextCloudPi up to date"; exit 0; } -test -e \$NOTIFIED && [[ "\$( cat \$LATEST )" == "\$( cat \$NOTIFIED )" ]] && { - echo "Found update from \$( cat \$VERFILE ) to \$( cat \$LATEST ). Already notified" +test -e \$NOTIFIED && [[ "\$( cat \$LATEST )" == "\$( cat \$NOTIFIED )" ]] && { + echo "Found update from \$( cat \$VERFILE ) to \$( cat \$LATEST ). Already notified" exit 0 } @@ -81,7 +81,7 @@ EOF chmod +x /usr/local/bin/ncp-notify-unattended-upgrade # check every hour at 40th minute - echo "40 */${CHECKINTERVAL} * * * root /usr/local/bin/ncp-notify-update && /usr/local/bin/ncp-notify-unattended-upgrade" > /etc/cron.d/ncp-notify-updates + echo -e "MAILTO=\"\"\n40 */${CHECKINTERVAL} * * * root /usr/local/bin/ncp-notify-update && /usr/local/bin/ncp-notify-unattended-upgrade" > /etc/cron.d/ncp-notify-updates chmod 644 /etc/cron.d/ncp-notify-updates [[ -f /run/crond.pid ]] && service cron restart |