2012-01-19 19:06:58 +01:00
|
|
|
#!/usr/local/bin/bash
|
|
|
|
|
|
|
|
if [ "$1" = "config" ]; then
|
|
|
|
echo "graph_title Available Updates"
|
2017-02-23 18:54:28 +01:00
|
|
|
echo "graph_category security"
|
2012-01-19 19:06:58 +01:00
|
|
|
echo "graph_args --base 1000 -l 0"
|
|
|
|
echo "graph_vlabel upgradeable packages/ports "
|
|
|
|
echo "pkg.label binary packages"
|
|
|
|
echo "ports.label ports"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" = "autoconf" ]; then
|
|
|
|
echo "yes"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
updates="$(freebsd-update fetch | \
|
|
|
|
grep -v 'Looking up update.FreeBSD.org mirrors' | \
|
|
|
|
grep -v 'Fetching metadata signature' | \
|
|
|
|
grep -v 'Fetching metadata index' | \
|
|
|
|
grep -v 'Inspecting system' | \
|
|
|
|
grep -v 'Preparing to download files' | \
|
|
|
|
grep -v -e '^$' | \
|
|
|
|
grep -v 'The following files will be added' | \
|
|
|
|
grep -v 'No updates needed' | \
|
|
|
|
grep -v 'The following files will be updated' | wc -l | sed -e 's/ //g' )"
|
|
|
|
|
|
|
|
updates="$(echo -n "${updates}")"
|
|
|
|
|
|
|
|
echo "pkg.value $updates"
|
|
|
|
|
|
|
|
|
|
|
|
updates="$(portversion | grep '<' | wc -l | sed -e 's/ //g')"
|
|
|
|
updates="$(echo -n "${updates}")"
|
|
|
|
|
|
|
|
echo "ports.value $updates"
|
|
|
|
|
|
|
|
exit 0
|