From 5245484a3c902ef35f0744ff40684dc47640d22a Mon Sep 17 00:00:00 2001 From: Andrew Stowell Date: Fri, 24 Oct 2025 15:41:53 -0400 Subject: [PATCH] cloudflare script to give more meaningful response when creating records, and automatically including bin folders within host folder --- cloudflare.sh | 11 +++++++++-- setup/1-choose-packages.sh | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/cloudflare.sh b/cloudflare.sh index 91217e1..7e7db32 100755 --- a/cloudflare.sh +++ b/cloudflare.sh @@ -189,8 +189,15 @@ while read -r result; do --data "$newRecord" ) # display if successful, and any messages - echo "$create" | jq -r '.success,.messages[]' - exit 0 + success=$(echo "$create" | jq -r '.success,.messages[]') + domain=$(echo "$newRecord" | jq -r '.name') + if [[ "$success" == "true" ]]; then + echo "created $domain record" + exit 0 + else + echo "failed to create $domain" + exit 1 + fi else echo 'No DNS Records found to update, stopping.' exit 1 diff --git a/setup/1-choose-packages.sh b/setup/1-choose-packages.sh index c839782..aa491dd 100755 --- a/setup/1-choose-packages.sh +++ b/setup/1-choose-packages.sh @@ -64,6 +64,28 @@ echo '' # ---------------------------------------------------------- +read -p 'Configure PATH for scripts in host services? [y/N]: ' response +case "${response}" in + [Yy]* ) + make_bashrc_backup + mkdir "$HOME/host" + ( cat << 'BASHRC' + +# ABS include host bin folders +host_bin=$(find "$HOME/host" -maxdepth 2 -type d -name bin | tr '\n' ':') +export PATH="$host_bin$PATH" + +BASHRC +) >> "${HOME}/.bashrc" + ;; + * ) + echo 'Skipping' + ;; +esac +echo '' + +# ---------------------------------------------------------- + install_collection 'core utilities: (curl, python3, jq, htop, etc.)' curl git htop jq grep gzip net-tools goaccess dnsutils bash-completion cron vim make chrony build-essential gcc inotify-tools python3 python-is-python3 screen bc # ----------------------------------------------------------