Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
7dc548b4
Commit
7dc548b4
authored
Mar 23, 2017
by
Jason
Committed by
GitHub
Mar 23, 2017
Browse files
MORE bs
parent
2c37d946
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_infoblox.sh
View file @
7dc548b4
...
@@ -25,7 +25,7 @@ dns_infoblox_add() {
...
@@ -25,7 +25,7 @@ dns_infoblox_add() {
_saveaccountconf Infoblox_Server
"
$Infoblox_Server
"
_saveaccountconf Infoblox_Server
"
$Infoblox_Server
"
## Base64 encode the credentials
## Base64 encode the credentials
Infoblox_CredsEncoded
=
$(
echo
-n
"
$Infoblox_Creds
"
| _base64
)
Infoblox_CredsEncoded
=
$(
printf
"%b"
"
$Infoblox_Creds
"
| _base64
)
## Construct the HTTP Authorization header
## Construct the HTTP Authorization header
export
_H1
=
"Accept-Language:en-US"
export
_H1
=
"Accept-Language:en-US"
...
@@ -57,7 +57,7 @@ dns_infoblox_rm() {
...
@@ -57,7 +57,7 @@ dns_infoblox_rm() {
_debug txtvalue
"
$txtvalue
"
_debug txtvalue
"
$txtvalue
"
## Base64 encode the credentials
## Base64 encode the credentials
Infoblox_CredsEncoded
=
$(
echo
-n
"
$Infoblox_Creds
"
| _base64
)
Infoblox_CredsEncoded
=
$(
printf
"%b"
"
$Infoblox_Creds
"
| _base64
)
## Construct the HTTP Authorization header
## Construct the HTTP Authorization header
export
_H1
=
"Accept-Language:en-US"
export
_H1
=
"Accept-Language:en-US"
...
@@ -70,7 +70,7 @@ dns_infoblox_rm() {
...
@@ -70,7 +70,7 @@ dns_infoblox_rm() {
## Let's see if we get something intelligible back from the grid
## Let's see if we get something intelligible back from the grid
if
echo
"
$result
"
| egrep
'record:txt/.*:.*/default'
;
then
if
echo
"
$result
"
| egrep
'record:txt/.*:.*/default'
;
then
## Extract the object reference
## Extract the object reference
objRef
=
$(
_egrep_o
'record:txt/.*:.*/default'
<<<
$result
)
objRef
=
$(
printf
"%b"
"
$result
"
|
_egrep_o
'record:txt/.*:.*/default'
)
objRmUrl
=
"https://
$Infoblox_Server
/wapi/v2.2.2/
$objRef
"
objRmUrl
=
"https://
$Infoblox_Server
/wapi/v2.2.2/
$objRef
"
## Delete them! All the stale records!
## Delete them! All the stale records!
rmResult
=
$(
_post
""
"
$objRmUrl
"
""
"DELETE"
)
rmResult
=
$(
_post
""
"
$objRmUrl
"
""
"DELETE"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment