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: #23
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,12 @@
|
|||||||
# Maps physical drive bays to logical device names using PCI paths
|
# 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"
|
VERSION="1.1.0"
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user