fix dry_run_wrapper()

This commit is contained in:
Michael Schnerring
2020-09-09 19:53:18 +02:00
parent bfa816c68b
commit f5b2fba114

View File

@@ -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 <directory> 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