|
260 | 260 | # 2021-02-18 Add FULL_CHAIN_INCLUDE_ROOT |
261 | 261 | # 2021-03-25 Fix DNS challenge completion check if CNAMEs on different NS are used (sideeffect42)(2.35) |
262 | 262 | # 2021-05-08 Merge from tlhackque/getssl: GoDaddy, split-view, tempfile permissions fixes, --version(2.36) |
| 263 | +# 2021-07-12 Do not redirect outputs on remote commands when the debug option is used (atisne) |
263 | 264 | # ---------------------------------------------------------------------------------------- |
264 | 265 |
|
265 | 266 | case :$SHELLOPTS: in |
@@ -329,6 +330,7 @@ _MUTE=0 |
329 | 330 | _NOTIFY_VALID=0 |
330 | 331 | _QUIET=0 |
331 | 332 | _RECREATE_CSR=0 |
| 333 | +_REDIRECT_OUTPUT="1>/dev/null 2>&1" |
332 | 334 | _REVOKE=0 |
333 | 335 | _RUNNING_TEST=0 |
334 | 336 | _TEST_SKIP_CNAME_CALL=0 |
@@ -1365,10 +1367,10 @@ for d in "${alldomains[@]}"; do |
1365 | 1367 | if [[ "${t_loc:0:4}" == "ssh:" ]] ; then |
1366 | 1368 | sshhost=$(echo "${t_loc}"| awk -F: '{print $2}') |
1367 | 1369 | command="rm -f ${t_loc:(( ${#sshhost} + 5))}/${token:?}" |
1368 | | - debug "running following command to remove token" |
1369 | | - debug "ssh $SSH_OPTS $sshhost ${command}" |
| 1370 | + debug "running following command to remove token:" |
| 1371 | + debug "ssh $SSH_OPTS $sshhost ${command} $_REDIRECT_OUTPUT" |
1370 | 1372 | # shellcheck disable=SC2029 disable=SC2086 |
1371 | | - ssh $SSH_OPTS "$sshhost" "${command}" 1>/dev/null 2>&1 |
| 1373 | + ssh $SSH_OPTS "$sshhost" "${command}" $_REDIRECT_OUTPUT |
1372 | 1374 | rm -f "${TEMP_DIR:?}/${token:?}" |
1373 | 1375 | elif [[ "${t_loc:0:4}" == "ftp:" ]] ; then |
1374 | 1376 | debug "using ftp to remove token file" |
@@ -2101,10 +2103,10 @@ reload_service() { # Runs a command to reload services ( via ssh if needed) |
2101 | 2103 | sshhost=$(echo "$ARELOAD_CMD"| awk -F: '{print $2}') |
2102 | 2104 | command=${ARELOAD_CMD:(( ${#sshhost} + 5))} |
2103 | 2105 | debug "running following command to reload cert:" |
2104 | | - debug "ssh $SSH_OPTS $sshhost ${command}" |
| 2106 | + debug "ssh $SSH_OPTS $sshhost ${command} $_REDIRECT_OUTPUT" |
2105 | 2107 | # shellcheck disable=SC2029 |
2106 | 2108 | # shellcheck disable=SC2086 |
2107 | | - ssh $SSH_OPTS "$sshhost" "${command}" 1>/dev/null 2>&1 |
| 2109 | + ssh $SSH_OPTS "$sshhost" "${command}" $_REDIRECT_OUTPUT |
2108 | 2110 | # allow 2 seconds for services to restart |
2109 | 2111 | sleep 2 |
2110 | 2112 | else |
@@ -2651,6 +2653,11 @@ while [[ -n ${1+defined} ]]; do |
2651 | 2653 | shift |
2652 | 2654 | done |
2653 | 2655 |
|
| 2656 | +if [[ ${_USE_DEBUG} -eq 1 ]]; then |
| 2657 | + # Do not hide outputs when debug mode is on |
| 2658 | + _REDIRECT_OUTPUT="" |
| 2659 | +fi |
| 2660 | + |
2654 | 2661 | # Main logic |
2655 | 2662 | ############ |
2656 | 2663 |
|
|
0 commit comments