diff options
author | Benedikt Böhm <bb@xnull.de> | 2009-07-20 10:10:07 +0200 |
---|---|---|
committer | Benedikt Böhm <bb@xnull.de> | 2009-07-20 10:10:07 +0200 |
commit | cf93c642072939bac80fd2a50f05705959ba1f91 (patch) | |
tree | bbf52aca7eb41d4a569fa7c32e9699764de1d90f | |
parent | make mkrelease generate new templated project pages (diff) | |
download | porticron-cf93c642072939bac80fd2a50f05705959ba1f91.tar.gz porticron-cf93c642072939bac80fd2a50f05705959ba1f91.tar.bz2 porticron-cf93c642072939bac80fd2a50f05705959ba1f91.zip |
add GLSA report
-rwxr-xr-x | bin/porticron | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/bin/porticron b/bin/porticron index 3a1c0bb..3761e30 100755 --- a/bin/porticron +++ b/bin/porticron @@ -82,3 +82,41 @@ ${DIFF_MSG}${UPGRADE_MSG} -- ${SCRIPT_NAME} EOF + + +# GLSA check +GLSA_AFFECTED=$(/usr/bin/glsa-check --test --verbose affected 2>/dev/null) +GLSA_UPGRADES=$(/usr/bin/glsa-check --pretend affected | grep '^ ') + +if [[ -n ${GLSA_AFFECTED} ]]; then + GLSA_MSG=" +${SCRIPT_NAME} has detected that this system is affected by the following GLSAs: + +$(echo "${GLSA_AFFECTED}" | sed 's/^20/ 20/') + +======================================================================== + +The following updates should be performed for these GLSAs: + +${GLSA_UPGRADES} +" +fi + + +# send mail +if [[ -z ${GLSA_MSG} ]]; then + exit 0 +fi + +cat <<EOF | ${SENDMAIL:-/usr/sbin/sendmail} -t +To: ${RCPT:-root@${FQDN}} +From: root@${FQDN} +Subject: WARNING: Gentoo security updates on ${FQDN} [ ${IP} ] +Date: ${DATE} + +porticron report [${DATE}] +======================================================================== +${GLSA_MSG} +-- +${SCRIPT_NAME} +EOF |