|
|
|
@ -813,7 +813,7 @@ get_auth_dns() { # get the authoritative dns server for a domain (sets primary_n |
|
|
|
return |
|
|
|
fi |
|
|
|
|
|
|
|
res=$(nslookup -debug=1 -type=soa -type=ns "$gad_d" ${gad_s}) |
|
|
|
res=$(nslookup -debug -type=soa -type=ns "$gad_d" ${gad_s}) |
|
|
|
|
|
|
|
if [[ "$(echo "$res" | grep -c "Non-authoritative")" -gt 0 ]]; then |
|
|
|
# this is a Non-authoritative server, need to check for an authoritative one. |
|
|
|
@ -826,9 +826,9 @@ get_auth_dns() { # get the authoritative dns server for a domain (sets primary_n |
|
|
|
fi |
|
|
|
|
|
|
|
if [[ -z "$gad_s" ]]; then |
|
|
|
res=$(nslookup -debug=1 -type=soa -type=ns "$gad_d") |
|
|
|
res=$(nslookup -debug -type=soa -type=ns "$gad_d") |
|
|
|
else |
|
|
|
res=$(nslookup -debug=1 -type=soa -type=ns "$gad_d" "${gad_s}") |
|
|
|
res=$(nslookup -debug -type=soa -type=ns "$gad_d" "${gad_s}") |
|
|
|
fi |
|
|
|
|
|
|
|
if [[ "$(echo "$res" | grep -c "canonical name")" -gt 0 ]]; then |
|
|
|
@ -1027,7 +1027,7 @@ info() { # write out info as long as the quiet flag has not been set. |
|
|
|
|
|
|
|
json_awk() { # AWK json converter used for API2 - needs tidying up ;) |
|
|
|
# shellcheck disable=SC2086 |
|
|
|
echo $1 | awk ' |
|
|
|
echo "$1" | tr -d '\n' | awk ' |
|
|
|
{ |
|
|
|
tokenize($0) # while(get_token()) {print TOKEN} |
|
|
|
if (0 == parse()) { |
|
|
|
@ -1173,8 +1173,8 @@ function scream(msg) { |
|
|
|
} |
|
|
|
|
|
|
|
function tokenize(a1,pq,pb,ESCAPE,CHAR,STRING,NUMBER,KEYWORD,SPACE) { |
|
|
|
SPACE="[[:space:]]+" |
|
|
|
gsub(/"[^[:cntrl:]"\\]*((\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})[^[:cntrl:]"\\]*)*"|-?(0|[1-9][0-9]*)([.][0-9]*)?([eE][+-]?[0-9]*)?|null|false|true|[[:space:]]+|./, "\n&", a1) |
|
|
|
SPACE="[ \t\n]+" |
|
|
|
gsub(/"[^\001-\037"\\]*((\\[^u\001-\037]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])[^\001-\037"\\]*)*"|-?(0|[1-9][0-9]*)([.][0-9]*)?([eE][+-]?[0-9]*)?|null|false|true|[ \t\n]+|./, "\n&", a1) |
|
|
|
gsub("\n" SPACE, "\n", a1) |
|
|
|
sub(/^\n/, "", a1) |
|
|
|
ITOKENS=0 # get_token() helper |
|
|
|
|