From f68f8c095312448be3c73a99bb7e36562b1d20db Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Wed, 28 Jan 2026 08:09:58 -0700 Subject: [PATCH] moar todos on ssh_create_sign_verify --- customscripts/ssh_create_sign_verify | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/customscripts/ssh_create_sign_verify b/customscripts/ssh_create_sign_verify index 4a62aa2..1906d73 100644 --- a/customscripts/ssh_create_sign_verify +++ b/customscripts/ssh_create_sign_verify @@ -1,6 +1,8 @@ #!/bin/bash -set -euo pipefail # safety shit. fail on error, undeclared var, pipe filure +# set -x # debug mode +set -Eeuo pipefail # safety shit. fail to trap on any error, undeclared var, pipe filure IFS=$'\n\t' # safer handlin of filenames and shit with spaces, prevents splitting +trap 'error_handler $?' ERR # prettyful trap for error handlin :3 # these can be adjusted interactively default_email="anonymous@anonymous.com" @@ -11,6 +13,16 @@ default_public_files_dir_name="public_files" # set here not thrugh interactive txt_help_file_name="How_to_Verify_Signature.txt" +# my silly pretty lil error handler :3 +error_handler() { + local retcode="$1" # get dat retcode + # color da error output red :3 + local RED='\033[0;31m' # red color + local NO_COLOR='\033[0m' # reset to no color + echo -e "\n\n${RED}ERROR: Failure With Return Code: $retcode on Line: $BASH_LINENO at Second: $SECONDS Timestamp: $(date)${NO_COLOR}" + echo -e "${RED}Command:\n\t$BASH_COMMAND\n\n${NO_COLOR}" +} + ### todo: work in mktemp -d dir? ### todo: handle fix perms shit pls ### todo: handle file paths better