Skip to content

Commit

Permalink
fix dry_run_wrapper()
Browse files Browse the repository at this point in the history
  • Loading branch information
schnerring committed Sep 9, 2020
1 parent bfa816c commit f5b2fba
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions disk-burnin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
;;
Expand Down Expand Up @@ -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 <directory> wasn't provided
[ -z "${LOG_DIR}" ] && LOG_DIR="$(pwd)"
# Trim trailing slashes
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f5b2fba

Please sign in to comment.