Replaced 'grep -Eq' with 'egrep'

This commit is contained in:
Jason 2017-03-15 10:19:34 -05:00 committed by GitHub
parent 53dac094f4
commit bf0f5507ad

View File

@ -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