mirror of
https://github.com/speed47/spectre-meltdown-checker.git
synced 2024-12-21 18:48:03 +01:00
fix(batch): fix regression introduced by acf12a6
In batch mode, $echo_cmd was not initialized early enough, and caused this error: ./spectre-meltdown-checker.sh: 899: ./spectre-meltdown-checker.sh: -ne: not found Fix it by initing echo_cmd unconditionally at the start
This commit is contained in:
parent
acf12a6d2d
commit
d1c1f0f0f0
@ -99,14 +99,6 @@ global_critical=0
|
|||||||
global_unknown=0
|
global_unknown=0
|
||||||
nrpe_vuln=""
|
nrpe_vuln=""
|
||||||
|
|
||||||
echo_cmd=''
|
|
||||||
__echo()
|
|
||||||
{
|
|
||||||
opt="$1"
|
|
||||||
shift
|
|
||||||
_msg="$@"
|
|
||||||
|
|
||||||
if [ -z "$echo_cmd" ]; then
|
|
||||||
# find a sane `echo` command
|
# find a sane `echo` command
|
||||||
# we'll try to avoid using shell builtins that might not take options
|
# we'll try to avoid using shell builtins that might not take options
|
||||||
if which echo >/dev/null 2>&1; then
|
if which echo >/dev/null 2>&1; then
|
||||||
@ -117,7 +109,11 @@ __echo()
|
|||||||
fi
|
fi
|
||||||
# still empty ? fallback to builtin
|
# still empty ? fallback to builtin
|
||||||
[ -z "$echo_cmd" ] && echo_cmd=echo
|
[ -z "$echo_cmd" ] && echo_cmd=echo
|
||||||
fi
|
__echo()
|
||||||
|
{
|
||||||
|
opt="$1"
|
||||||
|
shift
|
||||||
|
_msg="$@"
|
||||||
|
|
||||||
if [ "$opt_no_color" = 1 ] ; then
|
if [ "$opt_no_color" = 1 ] ; then
|
||||||
# strip ANSI color codes
|
# strip ANSI color codes
|
||||||
|
Loading…
Reference in New Issue
Block a user