zeek/zeek-wrapper.in
Jon Siwek 70b45d1aba Merge remote-tracking branch 'origin/topic/robin/631-deprecation-v2'
During merge I split the test for bro_init/bro_done/bro_script_loaded
event errors into individual tests since the other testing of the zeek
versions of those events seemed fine to otherwise keep.

* origin/topic/robin/631-deprecation-v2:
  Update NEWS for naming changes.
  Small cleanup and updating submodules.
  Remove test for legacy plugin.
  Remove legancy symlinks in aux/.
  Add warnings when loading scripts ending in ".bro", or using legacy environment variables.
  Fix missing rename.
  No longer symlink local.zeek to local.bro.
  Update notice user agent.
  Remove old_comm_usage_is_ok.
  Remove bro-config.h.in and bro-path-dev.in.
  Change Bro wrapper script to now abort when old executable names are still used.
  Remove APIs that were explicitly deprecated to be removed in 3.1.
2020-01-30 19:19:56 -08:00

31 lines
708 B
Bash
Executable file

#! /usr/bin/env bash
#
# Wrapper to continue reporting usage of old names of executables.
# This will print an error to stderr if stdin/stdout/stderr
# are all connected to a tty. It will then abort with an error
# exit code.
function deprecated {
cat >&2 <<EOF
Error: Use of '$1' is no longer supported. Please use '$2' instead.
EOF
}
base=$(dirname $0)
old=$(basename $0)
new=$(echo "${old}" | sed 's/^bro/zeek/')
if [ "${new}" = "${old}" ]; then
echo "zeek-wrapper: this script is just a wrapper for old commands"
exit 1
fi
if [ ! -f "${base}/${new}" ]; then
echo "zeek-wrapper: ${new} not found"
exit 1
fi
test -t 0 && test -t 1 && test -t 2 && deprecated "${old}" "${new}"
exit 1