From c747a3fe302dfd3697fc1d9b6bcbe38e7d861d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Sachse?= <joerg.sachse@slub-dresden.de> Date: Thu, 18 Aug 2022 12:08:21 +0200 Subject: [PATCH] feat: check requirements of error_summary.sh before running the script --- files/error-summary.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/files/error-summary.sh b/files/error-summary.sh index 3c5b23f..14a1a59 100755 --- a/files/error-summary.sh +++ b/files/error-summary.sh @@ -21,6 +21,11 @@ else SERVER_LOG_DIR="/operational_shared/logs/${HOSTNAME}/" fi +# list external required binaries here (space separated) +REQUIREMENTS="help2man grep sed gzip man find file sort uniq" +for REQUIREMENT in ${REQUIREMENTS}; do + command -v "${REQUIREMENT}" >/dev/null 2>&1 || { echo >&2 "ERROR: '${REQUIREMENT}' required but not installed. Aborting."; exit 1; } +done ### CLI ARGUMENTS -- GitLab