From 6dc0b00efd9074ad048c144922f070feae36bcad Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Thu, 5 Feb 2026 12:18:02 -0500 Subject: [PATCH] Add shell safety options (pipefail) Added 'set -o pipefail' to ensure pipe failures are detected. Not using -e (errexit) as the script is designed for graceful degradation when optional tools (smartctl, ceph) are missing. Many commands intentionally redirect stderr to /dev/null. Not using -u (nounset) as the script uses ${var:-default} patterns extensively for optional variables. Fixes: https://code.lotusguild.org/LotusGuild/driveAtlas/issues/23 Co-Authored-By: Claude Opus 4.5 --- driveAtlas.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/driveAtlas.sh b/driveAtlas.sh index b99ba1b..f5b453b 100644 --- a/driveAtlas.sh +++ b/driveAtlas.sh @@ -5,6 +5,12 @@ # Maps physical drive bays to logical device names using PCI paths #============================================================================== +# Shell safety options: +# -o pipefail: Exit status of pipe is rightmost non-zero exit code +# Note: Not using -e (errexit) to allow graceful degradation when tools fail +# Note: Not using -u (nounset) as script uses ${var:-default} patterns +set -o pipefail + VERSION="1.1.0" #------------------------------------------------------------------------------