mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-10-09 20:22:54 +02:00
straighten global definitions in the very bottom
This commit is contained in:
24
testssl.sh
24
testssl.sh
@ -25326,23 +25326,23 @@ lets_roll() {
|
|||||||
################# main #################
|
################# main #################
|
||||||
|
|
||||||
|
|
||||||
RET=0 # this is a global as we can have a function main(), see #705. Should we toss then all local $ret?
|
RET=0 # this is a global as a function main() is problematic, see #705. Should we toss then all local $ret?
|
||||||
ip=""
|
IP="" # global used only here
|
||||||
stopwatch start
|
stopwatch start
|
||||||
local fname_date="$(date +"%Y%m%d-%H%M")"
|
FNAME_DATE="$(date +"%Y%m%d-%H%M")" # a global var, and a definition via local doesn't work here. Omiting definition above
|
||||||
|
|
||||||
lets_roll init
|
lets_roll init
|
||||||
initialize_globals
|
initialize_globals
|
||||||
check_base_requirements # needs to come after $do_html is defined
|
check_base_requirements # needs to come after $do_html is defined
|
||||||
parse_cmd_line "$@"
|
parse_cmd_line "$@"
|
||||||
# CMDLINE_PARSED has been set now. Don't put a function immediately after this which calls fatal().
|
# CMDLINE_PARSED has been set now. Don't put a function immediately after this which calls fatal().
|
||||||
# Rather put it after csv_header below.
|
# Rather put it after csv_header below.
|
||||||
# html_header() needs to be called early! Otherwise if html_out() is called before html_header() and the
|
# html_header() needs to be called early! Otherwise if html_out() is called before html_header() and the
|
||||||
# command line contains --htmlfile <htmlfile> or --html, it'll make problems with html output, see #692.
|
# command line contains --htmlfile <htmlfile> or --html, it'll make problems with html output, see #692.
|
||||||
# json_header and csv_header could be called later but for context reasons we'll leave it here
|
# json_header and csv_header could be called later but for context reasons we'll leave it here
|
||||||
html_header "${fname_date}"
|
html_header "${FNAME_DATE}"
|
||||||
json_header "${fname_date}"
|
json_header "${FNAME_DATE}"
|
||||||
csv_header "${fname_date}"
|
csv_header "${FNAME_DATE}"
|
||||||
get_install_dir
|
get_install_dir
|
||||||
# see #705, we need to source TLS_DATA_FILE here instead of in get_install_dir(), see #705
|
# see #705, we need to source TLS_DATA_FILE here instead of in get_install_dir(), see #705
|
||||||
[[ -r "$TLS_DATA_FILE" ]] && . "$TLS_DATA_FILE"
|
[[ -r "$TLS_DATA_FILE" ]] && . "$TLS_DATA_FILE"
|
||||||
@ -25367,7 +25367,7 @@ lets_roll() {
|
|||||||
fileout_banner
|
fileout_banner
|
||||||
|
|
||||||
if "$do_mass_testing"; then
|
if "$do_mass_testing"; then
|
||||||
prepare_logging "${fname_date}"
|
prepare_logging "${FNAME_DATE}"
|
||||||
if [[ "$MASS_TESTING_MODE" == parallel ]]; then
|
if [[ "$MASS_TESTING_MODE" == parallel ]]; then
|
||||||
run_mass_testing_parallel
|
run_mass_testing_parallel
|
||||||
else
|
else
|
||||||
@ -25382,12 +25382,12 @@ lets_roll() {
|
|||||||
#FIXME: do we need this really here?
|
#FIXME: do we need this really here?
|
||||||
count_do_variables # if we have just 1x "do_*" --> we do a standard run -- otherwise just the one specified
|
count_do_variables # if we have just 1x "do_*" --> we do a standard run -- otherwise just the one specified
|
||||||
[[ $? -eq 1 ]] && set_scanning_defaults
|
[[ $? -eq 1 ]] && set_scanning_defaults
|
||||||
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
|
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
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ -z "$NODE" ]] && parse_hn_port "${URI}" # NODE, URL_PATH, PORT, IPADDRs2CHECK and IPADDRs2SHOW is set now
|
[[ -z "$NODE" ]] && parse_hn_port "${URI}" # NODE, URL_PATH, PORT, IPADDRs2CHECK and IPADDRs2SHOW is set now
|
||||||
prepare_logging "${fname_date}"
|
prepare_logging "${FNAME_DATE}"
|
||||||
|
|
||||||
if [[ -n "$PROXY" ]] && $DNS_VIA_PROXY; then
|
if [[ -n "$PROXY" ]] && $DNS_VIA_PROXY; then
|
||||||
NODEIP="$NODE"
|
NODEIP="$NODE"
|
||||||
@ -25406,10 +25406,10 @@ lets_roll() {
|
|||||||
pr_bold "Testing all IP addresses (port $PORT): "
|
pr_bold "Testing all IP addresses (port $PORT): "
|
||||||
fi
|
fi
|
||||||
outln "$IPADDRs2CHECK"
|
outln "$IPADDRs2CHECK"
|
||||||
for ip in $IPADDRs2CHECK; do
|
for IP in $IPADDRs2CHECK; do
|
||||||
draw_line "-" $((TERM_WIDTH * 2 / 3))
|
draw_line "-" $((TERM_WIDTH * 2 / 3))
|
||||||
outln
|
outln
|
||||||
NODEIP="$ip"
|
NODEIP="$IP"
|
||||||
lets_roll "${STARTTLS_PROTOCOL}"
|
lets_roll "${STARTTLS_PROTOCOL}"
|
||||||
RET=$((RET + $?)) # RET value per IP address
|
RET=$((RET + $?)) # RET value per IP address
|
||||||
done
|
done
|
||||||
|
Reference in New Issue
Block a user