mirror of
https://github.com/Spearfoot/disk-burnin-and-testing.git
synced 2025-12-05 23:53:31 +00:00
fix dry_run_wrapper()
This commit is contained in:
@@ -200,7 +200,7 @@ while getopts ':hefo:' option; do
|
|||||||
echo "${USAGE_2}"
|
echo "${USAGE_2}"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
f) DRY_RUN=0
|
f) readonly DRY_RUN=0
|
||||||
;;
|
;;
|
||||||
o) LOG_DIR="${OPTARG}"
|
o) LOG_DIR="${OPTARG}"
|
||||||
;;
|
;;
|
||||||
@@ -249,10 +249,6 @@ if ! printf '%s' "${DRIVE}" | grep "/dev/\w*" > /dev/null 2>&1; then
|
|||||||
fi
|
fi
|
||||||
readonly DRIVE
|
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
|
# Set to working directory if -o <directory> wasn't provided
|
||||||
[ -z "${LOG_DIR}" ] && LOG_DIR="$(pwd)"
|
[ -z "${LOG_DIR}" ] && LOG_DIR="$(pwd)"
|
||||||
# Trim trailing slashes
|
# Trim trailing slashes
|
||||||
@@ -428,7 +424,7 @@ cleanup_log() {
|
|||||||
##################################################
|
##################################################
|
||||||
dry_run_wrapper()
|
dry_run_wrapper()
|
||||||
{
|
{
|
||||||
if [ "$DRY_RUN" ]; then
|
if [ -z "$DRY_RUN" ]; then
|
||||||
log_info "DRY RUN: $*"
|
log_info "DRY RUN: $*"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user