Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / usr / lib / update-notifier / | server ip : 104.21.89.46 your ip : 172.70.80.99 H O M E |
Filename | /usr/lib/update-notifier/update-motd-updates-available |
Size | 1.16 kb |
Permission | rwxr-xr-x |
Owner | root : root |
Create time | 27-Apr-2025 09:55 |
Last modified | 10-Apr-2014 06:09 |
Last accessed | 05-Jul-2025 11:24 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
#!/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"
#
# 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"