mirror of
https://github.com/speed47/spectre-meltdown-checker
synced 2025-01-09 12:43:59 +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_unknown=0
|
||||||
nrpe_vuln=""
|
nrpe_vuln=""
|
||||||
|
|
||||||
|
ret=0
|
||||||
|
|
||||||
__echo()
|
__echo()
|
||||||
{
|
{
|
||||||
opt="$1"
|
opt="$1"
|
||||||
@ -365,6 +367,9 @@ pvulnstatus()
|
|||||||
VULN) pstatus red 'VULNERABLE' "$@";;
|
VULN) pstatus red 'VULNERABLE' "$@";;
|
||||||
OK) pstatus green 'NOT VULNERABLE' "$@";;
|
OK) pstatus green 'NOT VULNERABLE' "$@";;
|
||||||
esac
|
esac
|
||||||
|
case "$vulnstatus" in
|
||||||
|
UNK|VULN) ret=1
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -980,3 +985,5 @@ fi
|
|||||||
if [ "$opt_batch" = 1 -a "$opt_batch_format" = "json" ]; then
|
if [ "$opt_batch" = 1 -a "$opt_batch_format" = "json" ]; then
|
||||||
_echo 0 ${json_output%?}]
|
_echo 0 ${json_output%?}]
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
exit $ret
|
||||||
|
Loading…
Reference in New Issue
Block a user