#!/bin/sh # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # Blame solar.. [[ ! -x /usr/bin/glsa-check ]] && return 1 hostname="$(sysctl kernel.hostname | awk '{print $3}')" domainname="$(sysctl kernel.domainname|awk '{print $3}')" WHO=$(getent group wheel | cut -d : -f 4- | tr , '\n'| grep -v ^root$| awk '{print $1"@gentoo.org"}' | tr '\n' ,) WHO="infrastructure@gentoo.org" FQDN="${hostname}.${domainname}" GLSAS="$(/usr/bin/glsa-check -nl 2>/dev/null | /bin/sed -ne '/^[^[:space:]]\+[[:space:]]\[N\]/p' | awk '{print $1}')" if [[ "$GLSAS" != "" ]]; then for glsa in $GLSAS ; do glsa-check -d $glsa 2> /dev/null done | mail -s "GLSA ALERT: $FQDN" ${WHO} fi :