ddns-scripts: Support Bearer Token for Cloudflare

This commit is contained in:
P3TERX 2020-10-13 00:15:18 +08:00 committed by GitHub
parent c2632091b8
commit 4ab663a16d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,8 +125,13 @@ elif [ -z "$CURL_PROXY" ]; then
write_log 13 "cURL: libcurl compiled without Proxy support"
fi
# set headers
if [ "$username" = "Bearer" ]; then
write_log 7 "Found Username 'Bearer' using Password as Bearer Authorization Token"
__PRGBASE="$__PRGBASE --header 'Authorization: Bearer $password' "
else
__PRGBASE="$__PRGBASE --header 'X-Auth-Email: $username' "
__PRGBASE="$__PRGBASE --header 'X-Auth-Key: $password' "
fi
__PRGBASE="$__PRGBASE --header 'Content-Type: application/json' "
# read zone id for registered domain.TLD