|
|
@ -118,16 +118,16 @@ fn_stop_graceful_sdtd(){ |
|
|
|
elif [ "$(command -v expect 2>/dev/null)" ]; then |
|
|
|
# Tries to shutdown with both localhost and server IP. |
|
|
|
for telnetip in 127.0.0.1 ${ip}; do |
|
|
|
fn_print_dots "Graceful: telnet: ${telnetip}" |
|
|
|
fn_script_log_info "Graceful: telnet: ${telnetip}" |
|
|
|
fn_print_dots "Graceful: telnet: ${telnetip}:${telnetport}" |
|
|
|
fn_script_log_info "Graceful: telnet: ${telnetip}:${telnetport}" |
|
|
|
sleep 0.5 |
|
|
|
fn_stop_telnet_sdtd |
|
|
|
completed=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Completed.") |
|
|
|
refused=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Timeout or EOF") |
|
|
|
if [ -n "${refused}" ]; then |
|
|
|
fn_print_error "Graceful: telnet: ${telnetip}: " |
|
|
|
fn_print_error "Graceful: telnet: ${telnetip}:${telnetport} : " |
|
|
|
fn_print_fail_eol_nl |
|
|
|
fn_script_log_error "Graceful: telnet: ${telnetip}: FAIL" |
|
|
|
fn_script_log_error "Graceful: telnet: ${telnetip}:${telnetport} : FAIL" |
|
|
|
sleep 1 |
|
|
|
elif [ -n "${completed}" ]; then |
|
|
|
break |
|
|
@ -141,9 +141,9 @@ fn_stop_graceful_sdtd(){ |
|
|
|
fn_stop_telnet_sdtd |
|
|
|
refused=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Timeout or EOF") |
|
|
|
if [ -n "${refused}" ]; then |
|
|
|
fn_print_ok "Graceful: telnet: ${telnetip}: " |
|
|
|
fn_print_ok "Graceful: telnet: ${telnetip}:${telnetport}: " |
|
|
|
fn_print_ok_eol_nl |
|
|
|
fn_script_log_pass "Graceful: telnet: ${telnetip}: ${seconds} seconds" |
|
|
|
fn_script_log_pass "Graceful: telnet: ${telnetip}:${telnetport}: ${seconds} seconds" |
|
|
|
break |
|
|
|
fi |
|
|
|
sleep 1 |
|
|
@ -155,7 +155,7 @@ fn_stop_graceful_sdtd(){ |
|
|
|
if [ -n "${refused}" ]; then |
|
|
|
fn_print_error "Graceful: telnet: " |
|
|
|
fn_print_fail_eol_nl |
|
|
|
fn_script_log_error "Graceful: telnet: ${telnetip}: FAIL" |
|
|
|
fn_script_log_error "Graceful: telnet: ${telnetip}:${telnetport}: FAIL" |
|
|
|
else |
|
|
|
fn_print_error_nl "Graceful: telnet: Unknown error" |
|
|
|
fn_script_log_error "Graceful: telnet: Unknown error" |
|
|
|