Skip to content

Commit e8ab2c7

Browse files
committed
straighten global definitions in the very bottom
1 parent 1d6ddfb commit e8ab2c7

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

testssl.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25326,23 +25326,23 @@ lets_roll() {
2532625326
################# main #################
2532725327

2532825328

25329-
RET=0 # this is a global as we can have a function main(), see #705. Should we toss then all local $ret?
25330-
ip=""
25329+
RET=0 # this is a global as a function main() is problematic, see #705. Should we toss then all local $ret?
25330+
IP="" # global used only here
2533125331
stopwatch start
25332-
local fname_date="$(date +"%Y%m%d-%H%M")"
25332+
FNAME_DATE="$(date +"%Y%m%d-%H%M")" # a global var, and a definition via local doesn't work here. Omiting definition above
2533325333

2533425334
lets_roll init
2533525335
initialize_globals
25336-
check_base_requirements # needs to come after $do_html is defined
25336+
check_base_requirements # needs to come after $do_html is defined
2533725337
parse_cmd_line "$@"
2533825338
# CMDLINE_PARSED has been set now. Don't put a function immediately after this which calls fatal().
2533925339
# Rather put it after csv_header below.
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 "${fname_date}"
25344-
json_header "${fname_date}"
25345-
csv_header "${fname_date}"
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 "${fname_date}"
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 "${fname_date}" "${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 "${fname_date}"
25390+
prepare_logging "${FNAME_DATE}"
2539125391

2539225392
if [[ -n "$PROXY" ]] && $DNS_VIA_PROXY; then
2539325393
NODEIP="$NODE"
@@ -25406,10 +25406,10 @@ lets_roll() {
2540625406
pr_bold "Testing all IP addresses (port $PORT): "
2540725407
fi
2540825408
outln "$IPADDRs2CHECK"
25409-
for ip in $IPADDRs2CHECK; do
25409+
for IP in $IPADDRs2CHECK; do
2541025410
draw_line "-" $((TERM_WIDTH * 2 / 3))
2541125411
outln
25412-
NODEIP="$ip"
25412+
NODEIP="$IP"
2541325413
lets_roll "${STARTTLS_PROTOCOL}"
2541425414
RET=$((RET + $?)) # RET value per IP address
2541525415
done

0 commit comments

Comments
 (0)