I purpose to check Gandi response access denied. In case on bad API key or token, Gandi answer with 403 json.
Without this modification, gad script will try to create a new record.
update() create()
new_record_message=$(get_json_field "message" "$new_record_json")
if echo "$new_record_json" | grep -iE ":403,|access was denied|httpforbidden" >/dev/null 2>&1 ; then
printf "Sorry, access was denied by gandi.\\n"
printf "new_record_json:\\n---\\n%s\\n---\\n\\n" "$new_record_json"
exit 9
fi
check()
record_json=$(rest "GET" "domains/${domain}/records/${1}/${record_type}")
if echo "$record_json" | grep -iE ":403,|access was denied|httpforbidden" >/dev/null 2>&1 ; then
printf "Sorry, access was denied by gandi.\\n"
printf "record_json:\\n---\\n%s\\n---\\n\\n" "$record_json"
exit 9
fi
I purpose to check Gandi response access denied. In case on bad API key or token, Gandi answer with 403 json.
Without this modification, gad script will try to create a new record.
update() create()
check()
thanks