/usr/lib/update-notifier/update-motd-updates-available is in update-notifier-common 0.154.1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | #!/bin/sh -e
#
# helper for update-motd
# poor mans force
if [ "$1" = "--force" ]; then
NEED_UPDATE_CHECK=yes
fi
# check time when we did the last update check
stamp="/var/lib/update-notifier/updates-available"
# get list dir
StateDir="/var/lib/apt/"
ListDir="lists/"
eval "$(apt-config shell StateDir Dir::State)"
eval "$(apt-config shell ListDir Dir::State::Lists)"
# get sources.list file
EtcDir="etc/apt/"
SourceList="sources.list"
eval "$(apt-config shell EtcDir Dir::Etc)"
eval "$(apt-config shell SourceList Dir::Etc::sourcelist)"
# check if we have a list file or sources.list that needs checking
if [ -e "$stamp" ]; then
if [ "$(find "/$StateDir/$ListDir" "/$EtcDir/$SourceList" -type f -newer "$stamp" -print -quit)" ]; then
NEED_UPDATE_CHECK=yes
fi
else
if [ "$(find "/$StateDir/$ListDir" "/$EtcDir/$SourceList" -type f -print -quit)" ]; then
NEED_UPDATE_CHECK=yes
fi
fi
# output something for update-motd
if [ -n "$NEED_UPDATE_CHECK" ]; then
{
echo ""
/usr/lib/update-notifier/apt-check --human-readable
echo ""
} > $stamp
fi
# output what we have (either cached or newly generated)
cat "$stamp"
|