Browse Source

feat: bypass termbin if site is down

develop
Daniel Gibbs 1 month ago
parent
commit
64980655f4
  1. 29
      lgsm/modules/command_postdetails.sh

29
lgsm/modules/command_postdetails.sh

@ -58,18 +58,27 @@ else
fi fi
fn_print_dots "termbin.com" fn_print_dots "termbin.com"
link=$(cat "${postdetailslog}" | nc termbin.com 9999 | tr -d '\n\0') link=$(cat "${postdetailslog}" | {
fn_print_ok_nl "termbin.com for 30D" nc -w 3 termbin.com 9999
fn_script_log_pass "termbin.com for 30D" echo $? > /tmp/nc_exit_status
pdurl="${link}" } | tr -d '\n\0')
nc_exit_status=$(cat /tmp/nc_exit_status)
if [ "${nc_exit_status}" -ne 0 ]; then
fn_print_error_nl "Failed to post to termbin.com"
fn_script_log_error "Failed to post to termbin.com"
else
fn_print_ok_nl "termbin.com for 30D"
fn_script_log_pass "termbin.com for 30D"
pdurl="${link}"
if [ "${firstcommandname}" == "POST-DETAILS" ]; then if [ "${firstcommandname}" == "POST-DETAILS" ]; then
echo -e "" echo -e ""
echo -e "Please share the following url for support: " echo -e "Please share the following url for support: "
echo -e "${italic}${pdurl}${default}" echo -e "${italic}${pdurl}${default}"
fi
fn_script_log_info "${pdurl}"
alerturl="${pdurl}"
fi fi
fn_script_log_info "${pdurl}"
alerturl="${pdurl}"
if [ -z "${exitbypass}" ]; then if [ -z "${exitbypass}" ]; then
core_exit.sh core_exit.sh

Loading…
Cancel
Save