@@ -1453,7 +1453,7 @@ fileout() {
14531453
14541454
14551455json_header() {
1456- local datetime_started ="$1"
1456+ local fname_date ="$1"
14571457 local fname_prefix
14581458 local filename_provided=false
14591459
@@ -1482,9 +1482,9 @@ json_header() {
14821482 fname_prefix="${FNAME_PREFIX}${NODE}_p${PORT}"
14831483 fi
14841484 if [[ -z "$JSONFILE" ]]; then
1485- JSONFILE="$fname_prefix-${datetime_started }.json"
1485+ JSONFILE="$fname_prefix-${fname_date }.json"
14861486 elif [[ -d "$JSONFILE" ]]; then
1487- JSONFILE="$JSONFILE/${fname_prefix}-${datetime_started }.json"
1487+ JSONFILE="$JSONFILE/${fname_prefix}-${fname_date }.json"
14881488 fi
14891489 # Silently reset APPEND var if the file doesn't exist as otherwise it won't be created
14901490 if "$APPEND" && [[ ! -s "$JSONFILE" ]]; then
@@ -1505,7 +1505,7 @@ json_header() {
15051505
15061506
15071507csv_header() {
1508- local datetime_started ="$1"
1508+ local fname_date ="$1"
15091509 local fname_prefix
15101510 local filename_provided=false
15111511
@@ -1531,9 +1531,9 @@ csv_header() {
15311531 fname_prefix="${FNAME_PREFIX}${NODE}_p${PORT}"
15321532 fi
15331533 if [[ -z "$CSVFILE" ]]; then
1534- CSVFILE="${fname_prefix}-${datetime_started }.csv"
1534+ CSVFILE="${fname_prefix}-${fname_date }.csv"
15351535 elif [[ -d "$CSVFILE" ]]; then
1536- CSVFILE="$CSVFILE/${fname_prefix}-${datetime_started }.csv"
1536+ CSVFILE="$CSVFILE/${fname_prefix}-${fname_date }.csv"
15371537 fi
15381538 # Silently reset APPEND var if the file doesn't exist as otherwise it won't be created
15391539 if "$APPEND" && [[ ! -s "$CSVFILE" ]]; then
@@ -1560,7 +1560,7 @@ csv_header() {
15601560################# END JSON file functions. START HTML functions ####################
15611561
15621562html_header() {
1563- local datetime_started ="$1"
1563+ local fname_date ="$1"
15641564 local fname_prefix
15651565 local filename_provided=false
15661566
@@ -1589,9 +1589,9 @@ html_header() {
15891589 fname_prefix="${FNAME_PREFIX}${NODE}_p${PORT}"
15901590 fi
15911591 if [[ -z "$HTMLFILE" ]]; then
1592- HTMLFILE="$fname_prefix-${datetime_started }.html"
1592+ HTMLFILE="$fname_prefix-${fname_date }.html"
15931593 elif [[ -d "$HTMLFILE" ]]; then
1594- HTMLFILE="$HTMLFILE/$fname_prefix-${datetime_started }.html"
1594+ HTMLFILE="$HTMLFILE/$fname_prefix-${fname_date }.html"
15951595 fi
15961596 # Silently reset APPEND var if the file doesn't exist as otherwise it won't be created
15971597 if "$APPEND" && [[ ! -s "$HTMLFILE" ]]; then
@@ -1639,7 +1639,7 @@ html_footer() {
16391639################# END HTML file functions ####################
16401640
16411641prepare_logging() {
1642- local datetime_started ="$1"
1642+ local fname_date ="$1"
16431643 # arg2: for testing mx records name we put a name of logfile in here, otherwise we get strange file names
16441644 local fname_prefix="$2"
16451645 local filename_provided=false
@@ -1658,10 +1658,10 @@ prepare_logging() {
16581658 [[ -z "$fname_prefix" ]] && fname_prefix="${FNAME_PREFIX}${NODE}_p${PORT}"
16591659
16601660 if [[ -z "$LOGFILE" ]]; then
1661- LOGFILE="$fname_prefix-${datetime_started }.log"
1661+ LOGFILE="$fname_prefix-${fname_date }.log"
16621662 elif [[ -d "$LOGFILE" ]]; then
16631663 # actually we were instructed to place all files in a DIR instead of the current working dir
1664- LOGFILE="$LOGFILE/$fname_prefix-${datetime_started }.log"
1664+ LOGFILE="$LOGFILE/$fname_prefix-${fname_date }.log"
16651665 else
16661666 : # just for clarity: a log file was specified, no need to do anything else
16671667 fi
@@ -23416,7 +23416,7 @@ draw_line() {
2341623416
2341723417
2341823418run_mx_all_ips() {
23419- local datetime_started ="$1"
23419+ local fname_date ="$1"
2342023420 local mxs mx
2342123421 local mxport
2342223422 local -i ret=0
@@ -23433,9 +23433,9 @@ run_mx_all_ips() {
2343323433 fi
2343423434 mxport=${3:-25}
2343523435 if [[ -n "$LOGFILE" ]] || [[ -n "$PARENT_LOGFILE" ]]; then
23436- prepare_logging "${datetime_started }"
23436+ prepare_logging "${fname_date }"
2343723437 else
23438- prepare_logging "${datetime_started }" "${FNAME_PREFIX}mx-$1"
23438+ prepare_logging "${fname_date }" "${FNAME_PREFIX}mx-$1"
2343923439 fi
2344023440 if [[ -n "$mxs" ]] && [[ "$mxs" != ' ' ]]; then
2344123441 [[ $(count_words "$mxs") -gt 1 ]] && MULTIPLE_CHECKS=true
@@ -25329,7 +25329,7 @@ lets_roll() {
2532925329 RET=0 # this is a global as we can have a function main(), see #705. Should we toss then all local $ret?
2533025330 ip=""
2533125331 stopwatch start
25332- datetime_started ="$(date +"%Y%m%d-%H%M")"
25332+ local fname_date ="$(date +"%Y%m%d-%H%M")"
2533325333
2533425334 lets_roll init
2533525335 initialize_globals
@@ -25340,9 +25340,9 @@ lets_roll() {
2534025340 # html_header() needs to be called early! Otherwise if html_out() is called before html_header() and the
2534125341 # command line contains --htmlfile <htmlfile> or --html, it'll make problems with html output, see #692.
2534225342 # json_header and csv_header could be called later but for context reasons we'll leave it here
25343- html_header "${datetime_started }"
25344- json_header "${datetime_started }"
25345- csv_header "${datetime_started }"
25343+ html_header "${fname_date }"
25344+ json_header "${fname_date }"
25345+ csv_header "${fname_date }"
2534625346 get_install_dir
2534725347 # see #705, we need to source TLS_DATA_FILE here instead of in get_install_dir(), see #705
2534825348 [[ -r "$TLS_DATA_FILE" ]] && . "$TLS_DATA_FILE"
@@ -25367,7 +25367,7 @@ lets_roll() {
2536725367 fileout_banner
2536825368
2536925369 if "$do_mass_testing"; then
25370- prepare_logging "${datetime_started }"
25370+ prepare_logging "${fname_date }"
2537125371 if [[ "$MASS_TESTING_MODE" == parallel ]]; then
2537225372 run_mass_testing_parallel
2537325373 else
@@ -25382,12 +25382,12 @@ lets_roll() {
2538225382 #FIXME: do we need this really here?
2538325383 count_do_variables # if we have just 1x "do_*" --> we do a standard run -- otherwise just the one specified
2538425384 [[ $? -eq 1 ]] && set_scanning_defaults
25385- run_mx_all_ips "${datetime_started }" "${URI}" $PORT # we should reduce run_mx_all_ips to what's necessary as below we have similar code
25385+ run_mx_all_ips "${fname_date }" "${URI}" $PORT # we should reduce run_mx_all_ips to what's necessary as below we have similar code
2538625386 exit $?
2538725387 fi
2538825388
2538925389 [[ -z "$NODE" ]] && parse_hn_port "${URI}" # NODE, URL_PATH, PORT, IPADDRs2CHECK and IPADDRs2SHOW is set now
25390- prepare_logging "${datetime_started }"
25390+ prepare_logging "${fname_date }"
2539125391
2539225392 if [[ -n "$PROXY" ]] && $DNS_VIA_PROXY; then
2539325393 NODEIP="$NODE"
0 commit comments