cloudflare script to give more meaningful response when creating records, and automatically including bin folders within host folder
This commit is contained in:
+9
-2
@@ -189,8 +189,15 @@ while read -r result; do
|
|||||||
--data "$newRecord" )
|
--data "$newRecord" )
|
||||||
|
|
||||||
# display if successful, and any messages
|
# display if successful, and any messages
|
||||||
echo "$create" | jq -r '.success,.messages[]'
|
success=$(echo "$create" | jq -r '.success,.messages[]')
|
||||||
exit 0
|
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
|
else
|
||||||
echo 'No DNS Records found to update, stopping.'
|
echo 'No DNS Records found to update, stopping.'
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -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
|
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
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user