From a21913a38df6f0e6472c0048af7d00f4a1990cc8 Mon Sep 17 00:00:00 2001 From: edvin norling Date: Sun, 29 May 2022 12:53:10 +0200 Subject: [PATCH] Add a check to see if gdb is installed This to help users to easily understand why nothing is happening when they run the script and gdb isn't installed. Signed-off-by: edvin norling --- truffleproc.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/truffleproc.sh b/truffleproc.sh index a17db20..37be5b0 100755 --- a/truffleproc.sh +++ b/truffleproc.sh @@ -16,6 +16,8 @@ CONTAINER="${CONTAINER_IMAGE}@${CONTAINER_SHA}" main() { ensure_sudo + ensure_bin "gdb" + echo "# coredumping pid ${PID}" coredump_pid @@ -37,6 +39,10 @@ ensure_sudo() { sudo touch /dev/null } +ensure_bin() { + which "$1" > /dev/null +} + coredump_pid() { cd "${TMP_DIR}"