bunnycdn-purge/run.sh

20 lines
296 B
Bash
Raw Normal View History

2021-05-06 19:00:56 -04:00
#!/bin/bash
set +x
if [[ -z "${URL}" ]]
then
echo "Please defind a URL"
exit 1
fi
if [[ -z "${BUNNYCDN_API}" ]]
then
echo "Please define API_TOKEN"
exit 1
fi
curl -s -X POST \
-H 'AccessKey: '"${BUNNYCDN_API}"'' \
-H 'Content-Length: 0' \
'https://api.bunny.net/purge?url='"${URL}"