Permalink
Browse files

added single quotes around [:cntrl:] to fix bug where cntrl is not ev…

…aluated properly in some environments
  • Loading branch information...
1 parent 7a7c1d2 commit 0aa265dda86e5a7703de4441b636f7912393b514 @nmistry nmistry committed Jun 30, 2012
Showing with 13 additions and 13 deletions.
  1. +1 −1 lib/auth.sh
  2. +4 −4 lib/func.sh
  3. +1 −1 rsdns-a.sh
  4. +1 −1 rsdns-aaaa.sh
  5. +1 −1 rsdns-cn.sh
  6. +1 −1 rsdns-dc.sh
  7. +1 −1 rsdns-did.sh
  8. +2 −2 rsdns-domain.sh
  9. +1 −1 rsdns-ns.sh
View
@@ -36,7 +36,7 @@ function get_auth () {
DNSSVR="https://dns.api.rackspacecloud.com/v1.0"
fi
- AUTH=`curl -s -X GET -D - -H X-Auth-User:\ $RSUSER -H X-Auth-Key:\ $RSAPIKEY $AUTHSVR|tr -s [:cntrl:] "\n" \
+ AUTH=`curl -s -X GET -D - -H X-Auth-User:\ $RSUSER -H X-Auth-Key:\ $RSAPIKEY $AUTHSVR|tr -s '[:cntrl:]' "\n" \
|awk '{ if ($1 == "HTTP/1.1") printf "%s,", $2 ; if ($1 == "X-Auth-Token:") printf "%s,", $2 ; if ($1 == "X-Server-Management-Url:") printf "%s,", $2 ;}' `
View
@@ -5,12 +5,12 @@
#gets the domains associated with an account.
function get_domains() {
- DOMAINS=`curl -k -s -X GET -H X-Auth-Token:\ $TOKEN $DNSSVR/$USERID/domains|tr -s [:cntrl:] "\n" |sed -e 's/{"domains":\[{//' -e 's/}\]}//' -e 's/},{/;/g' -e 's/"name"://g' -e 's/"id"://g' -e 's/"accountId"://g' -e 's/"updated"://g' -e 's/"created"://g' -e 's/"totalEntries"://g'`
+ DOMAINS=`curl -k -s -X GET -H X-Auth-Token:\ $TOKEN $DNSSVR/$USERID/domains|tr -s '[:cntrl:]' "\n" |sed -e 's/{"domains":\[{//' -e 's/}\]}//' -e 's/},{/;/g' -e 's/"name"://g' -e 's/"id"://g' -e 's/"accountId"://g' -e 's/"updated"://g' -e 's/"created"://g' -e 's/"totalEntries"://g'`
}
function get_records() {
- RECORDS=`curl -k -s -X GET -H X-Auth-Token:\ $TOKEN $DNSSVR/$USERID/domains/$DOMAINID/records|tr -s [:cntrl:] "\n"`
+ RECORDS=`curl -k -s -X GET -H X-Auth-Token:\ $TOKEN $DNSSVR/$USERID/domains/$DOMAINID/records|tr -s '[:cntrl:]' "\n"`
#echo $RECORDS
RECORDS=`echo $RECORDS | sed -e 's/{"records":\[{//' -e 's/}\]}//' -e 's/},{/;/g' -e 's/"name"://g' -e 's/"id"://g' -e 's/"type"://g' -e 's/"data"://g' -e 's/"updated"://g' -e 's/"created"://g' -e 's/"totalEntries"://g'`
}
@@ -107,7 +107,7 @@ function delete_record() {
get_recordid
- RC=`curl -k -s -X DELETE -D - -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/$DOMAINID/records/$RECORDID|tr -s [:cntrl:] "\n"`
+ RC=`curl -k -s -X DELETE -D - -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/$DOMAINID/records/$RECORDID|tr -s '[:cntrl:]' "\n"`
if [[ $QUIET -eq 0 ]]; then
echo $RC
@@ -117,7 +117,7 @@ function delete_record() {
function create_record() {
- RC=`curl -k -s -X POST -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/$DOMAINID/records --data "$RSPOST" |tr -s [:cntrl:] "\n"`
+ RC=`curl -k -s -X POST -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/$DOMAINID/records --data "$RSPOST" |tr -s '[:cntrl:]' "\n"`
#echo $RSPOST
View
@@ -73,7 +73,7 @@ function update_a() {
RSPOST=`echo '{ "name" : "'$NAME'", "data" : "'$IP'", "ttl" : '$TTL' }'`
- RC=`curl -k -s -X PUT -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/$DOMAINID/records/$RECORDID --data "$RSPOST" |tr -s [:cntrl:] "\n"`
+ RC=`curl -k -s -X PUT -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/$DOMAINID/records/$RECORDID --data "$RSPOST" |tr -s '[:cntrl:]' "\n"`
if [[ $QUIET -eq 0 ]]; then
View
@@ -73,7 +73,7 @@ function update_aaaa() {
RSPOST=`echo '{ "name" : "'$NAME'", "data" : "'$IP'", "ttl" : '$TTL' }'`
- RC=`curl -k -s -X PUT -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/$DOMAINID/records/$RECORDID --data "$RSPOST" |tr -s [:cntrl:] "\n"`
+ RC=`curl -k -s -X PUT -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/$DOMAINID/records/$RECORDID --data "$RSPOST" |tr -s '[:cntrl:]' "\n"`
if [[ $QUIET -eq 0 ]]; then
View
@@ -70,7 +70,7 @@ function update_cn() {
RSPOST=`echo '{ "name" : "'$NAME'", "data" : "'$CNAME'", "ttl" : '$TTL' }'`
- RC=`curl -k -s -X PUT -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/$DOMAINID/records/$RECORDID --data "$RSPOST" |tr -s [:cntrl:] "\n"`
+ RC=`curl -k -s -X PUT -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/$DOMAINID/records/$RECORDID --data "$RSPOST" |tr -s '[:cntrl:]' "\n"`
if [[ $QUIET -eq 0 ]]; then
View
@@ -126,7 +126,7 @@ then
# POST!
RSPOST=`echo '{ "name" : "'$NAME'", "data" : "'$IP'" }'`
- RC=`curl -k -s -X PUT -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/$DOMAINID/records/$RECORDID --data "$RSPOST" |tr -s [:cntrl:] "\n"`
+ RC=`curl -k -s -X PUT -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/$DOMAINID/records/$RECORDID --data "$RSPOST" |tr -s '[:cntrl:]' "\n"`
if [[ $QUIET -eq 0 ]]; then
echo $RC
View
@@ -89,7 +89,7 @@ fi
# get the domain ID :)
check_domain
- RC=`curl -k -s -X DELETE -D - -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/$DOMAINID/records/$ID|tr -s [:cntrl:] "\n"`
+ RC=`curl -k -s -X DELETE -D - -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/$DOMAINID/records/$ID|tr -s '[:cntrl:]' "\n"`
if [[ $QUIET -eq 0 ]]; then
echo $RC
View
@@ -42,7 +42,7 @@ if [ -z $EMAIL ]
# {"domains":[{"name":"example.com","ttl":86400,"emailAddress":"me@example.com"}]}
RSPOST=`echo '{"domains":[{ "name" : "'$DOMAIN'", "emailAddress" : "'$EMAIL'", "ttl" : '$TTL' }]}'`
- RC=`curl -k -s -X POST -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/ --data "$RSPOST" |tr -s [:cntrl:] "\n"`
+ RC=`curl -k -s -X POST -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/ --data "$RSPOST" |tr -s '[:cntrl:]' "\n"`
#echo $RSPOST
@@ -56,7 +56,7 @@ function delete_domain() {
check_domain
- RC=`curl -k -s -X DELETE -D - -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/$DOMAINID|tr -s [:cntrl:] "\n"`
+ RC=`curl -k -s -X DELETE -D - -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/$DOMAINID|tr -s '[:cntrl:]' "\n"`
if [[ $QUIET -eq 0 ]]; then
echo $RC
View
@@ -67,7 +67,7 @@ function update_ns() {
RSPOST=`echo '{ "name" : "'$DOMAIN'", "data" : "'$NEWNS'", "ttl" : '$TTL' }'`
- RC=`curl -k -s -X PUT -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/$DOMAINID/records/$RECORDID --data "$RSPOST" |tr -s [:cntrl:] "\n"`
+ RC=`curl -k -s -X PUT -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/$DOMAINID/records/$RECORDID --data "$RSPOST" |tr -s '[:cntrl:]' "\n"`
if [[ $QUIET -eq 0 ]]; then

0 comments on commit 0aa265d

Please sign in to comment.