Skip to content

Commit

Permalink
feat: bypass termbin if site is down
Browse files Browse the repository at this point in the history
  • Loading branch information
dgibbs64 committed Feb 24, 2025
1 parent 9be745f commit 6498065
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions lgsm/modules/command_postdetails.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,27 @@ else
fi

fn_print_dots "termbin.com"
link=$(cat "${postdetailslog}" | nc termbin.com 9999 | tr -d '\n\0')
fn_print_ok_nl "termbin.com for 30D"
fn_script_log_pass "termbin.com for 30D"
pdurl="${link}"
link=$(cat "${postdetailslog}" | {
nc -w 3 termbin.com 9999
echo $? > /tmp/nc_exit_status
} | 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
echo -e ""
echo -e "Please share the following url for support: "
echo -e "${italic}${pdurl}${default}"
if [ "${firstcommandname}" == "POST-DETAILS" ]; then
echo -e ""
echo -e "Please share the following url for support: "
echo -e "${italic}${pdurl}${default}"
fi
fn_script_log_info "${pdurl}"
alerturl="${pdurl}"
fi
fn_script_log_info "${pdurl}"
alerturl="${pdurl}"

if [ -z "${exitbypass}" ]; then
core_exit.sh
Expand Down

0 comments on commit 6498065

Please sign in to comment.