Skip to content
Snippets Groups Projects
Commit de1b6f87 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Better formatting -- only include package name. Added performance data.

parent 49bfd7f9
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
GLSA_TMP=`tempfile` GLSA_TMP=`tempfile`
GREP_TMP=`tempfile` GREP_TMP=`tempfile`
PACKAGE_TMP=`tempfile`
ERR_TMP=`tempfile` ERR_TMP=`tempfile`
trap "rm $GLSA_TMP $GREP_TMP $ERR_TMP" 0 trap "rm $GLSA_TMP $GREP_TMP $ERR_TMP" 0
glsa-check -l -n > $GLSA_TMP 2> $ERR_TMP glsa-check -l -n > $GLSA_TMP 2> $ERR_TMP
...@@ -19,13 +20,28 @@ then ...@@ -19,13 +20,28 @@ then
exit 3 exit 3
fi fi
grep '^[0-9][0-9]*-[0-9][0-9] \[[^AU]\]' < $GLSA_TMP > $GREP_TMP 2> $ERR_TMP grep '^[0-9][0-9]*-[0-9][0-9]* \[[^AU]\]' < $GLSA_TMP > $GREP_TMP 2> $ERR_TMP
RC=$? RC=$?
case $RC in case $RC in
0) echo CRITICAL - glsa-check found problems: `awk '{ print $0 " --- " }' $GREP_TMP` 0) problems=`wc -l < $GREP_TMP`
while read glsa rest
do
glsa-check -d $glsa 2>/dev/null \
|sed -n 's/^Affected package: *//p' \
|sort \
|uniq >> $PACKAGE_TMP
done < $GREP_TMP
progs=``
echo -n "CRITICAL - glsa-check found $problems problems affecting "
sort < $PACKAGE_TMP \
|uniq \
|awk 'NR > 1 { printf ", " }
{ printf $0 } ' \
|sed 's/, \([^,]*\)$/ and \1/'
echo ". | problems=$problems, packages=`sort $PACKAGE_TMP|uniq|wc -l`"
exit 2;; exit 2;;
1) echo OK - no GLSA-related problems found 1) echo "OK - no GLSA-related problems found. | problems=0, packages=0"
exit 0;; exit 0;;
*) echo UNKNOWN - grep returned $? *) echo UNKNOWN - grep returned $?
cat $ERR_TMP cat $ERR_TMP
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment