From 8746c76f336851fafaaa840ae6071f4eec23b0c9 Mon Sep 17 00:00:00 2001 From: Ronny Trommer Date: Fri, 3 Nov 2023 22:27:42 +0100 Subject: [PATCH] chg: Use strict bash and improve visualizing errors handling --- bootstrap-debian.sh | 3 +++ bootstrap-yum.sh | 3 +++ 2 files changed, 6 insertions(+) diff --git a/bootstrap-debian.sh b/bootstrap-debian.sh index 001116b..3f54aa7 100644 --- a/bootstrap-debian.sh +++ b/bootstrap-debian.sh @@ -2,6 +2,9 @@ # # Script to bootstrap a basic OpenNMS setup +set -eEuo pipefail +trap 's=$?; echo >&2 "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR + # Default build identifier set to stable DEBIAN_FRONTEND=noninteractive ERROR_LOG="bootstrap.log" diff --git a/bootstrap-yum.sh b/bootstrap-yum.sh index 4729bb7..dd855d7 100644 --- a/bootstrap-yum.sh +++ b/bootstrap-yum.sh @@ -2,6 +2,9 @@ # # Script to bootstrap a basic OpenNMS setup +set -eEuo pipefail +trap 's=$?; echo >&2 "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR + # Default build identifier set to stable ERROR_LOG="bootstrap.log" POSTGRES_USER="postgres"