#!/bin/sh
#
# /etc/cron.daily/upgrade-system
#
# COPYRIGHT © 2004-2020 Martin-Éric Racine <martin-eric.racine@iki.fi>
#
# LICENSE
# GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
#
# Abort if the binary has been removed.
if [ ! -x /usr/sbin/upgrade-system ]; then exit 0; fi
# Don't bother if unattended-upgrade is installed. It does the same thing.
if [ -x /usr/bin/unattended-upgrade ]; then exit 0; fi
# Don't bother if apt-show-versions is installed. It has its own cron job.
if [ -x /usr/bin/apt-show-versions ]; then exit 0; fi
# Don't bother if /sbin/init is systemd. APT ships native timers nowadays.
if [ -d /run/systemd/system ]; then exit 0; fi
LANGUAGE=C
LC_ALL=C
export LANGUAGE LC_ALL
apt-get --quiet --quiet update
apt-get --quiet --quiet autoclean
apt-get --simulate --verbose-versions upgrade | grep = | awk '{print $1,$2,"upgradeable to",$4}'
#EOF
