root / plugins / other / freebsd-upgrades @ 7e562477
Historique | Voir | Annoter | Télécharger (975 octets)
| 1 |
#!/usr/local/bin/bash |
|---|---|
| 2 |
|
| 3 |
if [ "$1" = "config" ]; then |
| 4 |
echo "graph_title Available Updates" |
| 5 |
echo "graph_category security" |
| 6 |
echo "graph_args --base 1000 -l 0" |
| 7 |
echo "graph_vlabel upgradeable packages/ports " |
| 8 |
echo "pkg.label binary packages" |
| 9 |
echo "ports.label ports" |
| 10 |
exit 0 |
| 11 |
fi |
| 12 |
|
| 13 |
if [ "$1" = "autoconf" ]; then |
| 14 |
echo "yes" |
| 15 |
exit 0 |
| 16 |
fi |
| 17 |
|
| 18 |
updates="$(freebsd-update fetch | \ |
| 19 |
grep -v 'Looking up update.FreeBSD.org mirrors' | \ |
| 20 |
grep -v 'Fetching metadata signature' | \ |
| 21 |
grep -v 'Fetching metadata index' | \ |
| 22 |
grep -v 'Inspecting system' | \ |
| 23 |
grep -v 'Preparing to download files' | \ |
| 24 |
grep -v -e '^$' | \ |
| 25 |
grep -v 'The following files will be added' | \ |
| 26 |
grep -v 'No updates needed' | \ |
| 27 |
grep -v 'The following files will be updated' | wc -l | sed -e 's/ //g' )" |
| 28 |
|
| 29 |
updates="$(echo -n "${updates}")"
|
| 30 |
|
| 31 |
echo "pkg.value $updates" |
| 32 |
|
| 33 |
|
| 34 |
updates="$(portversion | grep '<' | wc -l | sed -e 's/ //g')" |
| 35 |
updates="$(echo -n "${updates}")"
|
| 36 |
|
| 37 |
echo "ports.value $updates" |
| 38 |
|
| 39 |
exit 0 |
