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