Change Bro wrapper script to now abort when old executable names are still used.

This commit is contained in:
Robin Sommer 2020-01-27 12:01:27 +00:00
parent d0b206fa36
commit 0516f3f439

View file

@ -1,14 +1,13 @@
#! /usr/bin/env bash #! /usr/bin/env bash
# #
# Wrapper to continue supporting old names of executables. # Wrapper to continue reporting usage old names of executables.
# This will print a deprecation warning to stderr if (1) stdin/stdout/stderr # This will print an error warning to stderr if stdin/stdout/stderr
# are all connected to a tty, and (2) the environment variable ZEEK_IS_BRO # are all connected to a tty. In any case, it will abort with error
# is unset. # exit code.
function deprecated { function deprecated {
cat >&2 <<EOF cat >&2 <<EOF
Warning: Use of '$1' is deprecated. It is linked to a wrapper that Error: Use of '$1' is no longer supported. Please use '$2' instead.
will be removed in the future. Please use '$2' instead.
EOF EOF
} }
@ -27,6 +26,6 @@ if [ ! -f "${base}/${new}" ]; then
exit 1 exit 1
fi fi
test -t 0 && test -t 1 && test -t 2 && test -z "${ZEEK_IS_BRO}" && deprecated "${old}" "${new}" test -t 0 && test -t 1 && test -t 2 && deprecated "${old}" "${new}"
"${base}/${new}" "$@" exit 1