From f5b2fba114c9d6f7b81c679dbf613290956f21d0 Mon Sep 17 00:00:00 2001 From: Michael Schnerring <3743342+schnerring@users.noreply.github.com> Date: Wed, 9 Sep 2020 19:53:18 +0200 Subject: [PATCH] fix dry_run_wrapper() --- disk-burnin.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/disk-burnin.sh b/disk-burnin.sh index 0d8d115..f2298eb 100755 --- a/disk-burnin.sh +++ b/disk-burnin.sh @@ -200,7 +200,7 @@ while getopts ':hefo:' option; do echo "${USAGE_2}" exit ;; - f) DRY_RUN=0 + f) readonly DRY_RUN=0 ;; o) LOG_DIR="${OPTARG}" ;; @@ -249,10 +249,6 @@ if ! printf '%s' "${DRIVE}" | grep "/dev/\w*" > /dev/null 2>&1; then fi readonly DRIVE -# Run in dry mode if -f wasn't provided -[ -z "${DRY_RUN}" ] && DRY_RUN=1 -readonly DRY_RUN - # Set to working directory if -o wasn't provided [ -z "${LOG_DIR}" ] && LOG_DIR="$(pwd)" # Trim trailing slashes @@ -428,7 +424,7 @@ cleanup_log() { ################################################## dry_run_wrapper() { - if [ "$DRY_RUN" ]; then + if [ -z "$DRY_RUN" ]; then log_info "DRY RUN: $*" return 0 fi