Extract cloudflare details from file
This commit is contained in:
parent
eeda084d67
commit
4d7591f245
15
cfddns.sh
15
cfddns.sh
@ -26,6 +26,8 @@ exit 1
|
|||||||
unset PARAMS
|
unset PARAMS
|
||||||
unset accountFile
|
unset accountFile
|
||||||
dnsRecords=()
|
dnsRecords=()
|
||||||
|
cfDetails=()
|
||||||
|
|
||||||
|
|
||||||
### Process script parameters
|
### Process script parameters
|
||||||
if [ -z $1 ]; then
|
if [ -z $1 ]; then
|
||||||
@ -61,9 +63,16 @@ elif [ -z ${dnsRecords} ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
## Extract needed information from accountDetails file
|
||||||
|
mapfile -t cfDetails < "$accountFile"
|
||||||
|
|
||||||
|
|
||||||
### Echo results (testing)
|
### Echo results (testing)
|
||||||
echo "Based on parameters provided:"
|
echo -e "\nBased on parameters provided:"
|
||||||
echo "Login details at: ${accountFile}"
|
echo -e "\e[0;35mLogin details at: ${accountFile}"
|
||||||
echo "Updating records: ${dnsRecords[*]}"
|
echo -e "\tAuthorized email: ${cfDetails[0]}"
|
||||||
|
echo -e "\tAuthorized key: ${cfDetails[1]}"
|
||||||
|
echo -e "\tZone identifier: ${cfDetails[2]}"
|
||||||
|
echo -e "\e[0;33mUpdating records: ${dnsRecords[*]}\e[0m\n"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user