mirror of
https://github.com/speed47/spectre-meltdown-checker
synced 2025-01-08 20:33:09 +01:00
Return a sensible exit code
This commit is contained in:
parent
7f92717a2c
commit
b1d6d79729
@ -94,6 +94,8 @@ nrpe_critical=0
|
||||
nrpe_unknown=0
|
||||
nrpe_vuln=""
|
||||
|
||||
ret=0
|
||||
|
||||
__echo()
|
||||
{
|
||||
opt="$1"
|
||||
@ -365,6 +367,9 @@ pvulnstatus()
|
||||
VULN) pstatus red 'VULNERABLE' "$@";;
|
||||
OK) pstatus green 'NOT VULNERABLE' "$@";;
|
||||
esac
|
||||
case "$vulnstatus" in
|
||||
UNK|VULN) ret=1
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
@ -980,3 +985,5 @@ fi
|
||||
if [ "$opt_batch" = 1 -a "$opt_batch_format" = "json" ]; then
|
||||
_echo 0 ${json_output%?}]
|
||||
fi
|
||||
|
||||
exit $ret
|
||||
|
Loading…
Reference in New Issue
Block a user