Created
August 13, 2017 16:43
-
-
Save misodengaku/9bba09d81182ec546ad911e414060621 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TOKEN="access-token" | |
SECRET="access-secret" | |
ZONE="is1b" | |
ID="resource-id" | |
NAME=$1 | |
VALUE=$2 | |
RESULT=`curl --user "${TOKEN}":"${SECRET}" https://secure.sakura.ad.jp/cloud/zone/${ZONE}/api/cloud/1.1/commonserviceitem/${ID} 2>/dev/null | \ | |
python dns_filter.py "${NAME}" "${VALUE}" | \ | |
curl -XPUT --user "${TOKEN}":"${SECRET}" https://secure.sakura.ad.jp/cloud/zone/${ZONE}/api/cloud/1.1/commonserviceitem/${ID} -d @- 2>/dev/null | \ | |
jq .Success` | |
if [ ${RESULT} = "true" ]; then | |
echo "success" | |
else | |
echo "fail" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment