Browse Source

Replaced 'grep -Eq' with 'egrep'

pull/655/head
Jason 9 years ago
committed by GitHub
parent
commit
bf0f5507ad
  1. 6
      dns_infoblox.sh

6
dns_infoblox.sh

@ -29,7 +29,7 @@ dns_infoblox_add() {
result=`curl -k -u $Infoblox_Creds -X POST $baseurlnObject` result=`curl -k -u $Infoblox_Creds -X POST $baseurlnObject`
if _info "$result" | grep -Eq 'record:txt/.*:.*/default'; then
if _info "$result" | egrep 'record:txt/.*:.*/default'; then
_info "Successfully created the txt record" _info "Successfully created the txt record"
return 0 return 0
else else
@ -60,13 +60,13 @@ _info $baseurlnObject
result=`curl -k -u $Infoblox_Creds -X GET $baseurlnObject` result=`curl -k -u $Infoblox_Creds -X GET $baseurlnObject`
if _info "$result" | grep -Eq 'record:txt/.*:.*/default'; then
if _info "$result" | egrep 'record:txt/.*:.*/default'; then
# Extract object ref # Extract object ref
objRef=`grep -Po 'record:txt/.*:.*/default' <<< $result` objRef=`grep -Po 'record:txt/.*:.*/default' <<< $result`
objRmUrl="https://$Infoblox_Server/wapi/v2.2.2/$objRef" objRmUrl="https://$Infoblox_Server/wapi/v2.2.2/$objRef"
rmResult=`curl -k -u $Infoblox_Creds -X DELETE $objRmUrl` rmResult=`curl -k -u $Infoblox_Creds -X DELETE $objRmUrl`
# Check if rm succeeded # Check if rm succeeded
if _info "$rmResult" | grep -Eq 'record:txt/.*:.*/default'; then
if _info "$rmResult" | egrep 'record:txt/.*:.*/default'; then
_info "Successfully deleted $objRef" _info "Successfully deleted $objRef"
return 0 return 0
else else

Loading…
Cancel
Save