Possibilité d’utiliser drill avec le flag -d + parallélisation des requêtes

This commit is contained in:
bvaudour 2020-07-22 12:41:38 +02:00
parent 2dac13303d
commit 541671c38d
1 changed files with 26 additions and 5 deletions

View File

@ -22,8 +22,13 @@ fn digall [@_args]{
+answer +answer
] ]
local:domains = [] local:domains = []
local:use_dig = $true
fn init []{ fn init []{
if (and (> (count $_args) 0) (is $_args[0] -d)) {
use_dig = $false
_args = $_args[1:]
}
each [e]{ each [e]{
if (is $e[0] '+') { if (is $e[0] '+') {
flags = [ (all $flags) $e ] flags = [ (all $flags) $e ]
@ -40,17 +45,33 @@ fn digall [@_args]{
} }
} }
fn digr [d @args]{ fn drillr [d @args]{
local:results = [ (each [r]{ local:results = [ (peach [r]{
e:dig $@args $r $d $@flags e:drill $@args $r $d | list:filter [e]{
} $records) ] and (> (count $e) 2) (not (is $e[:2] ';;'))
results = [ (list:remove-duplicate $results) ] }
} $records | list:remove-duplicate) ]
echo (str:join "\n" $results) echo (str:join "\n" $results)
} }
fn digr [d @args]{
local:results = [ (peach [r]{
e:dig $@args $r $d $@flags
} $records | list:remove-duplicate) ]
echo (str:join "\n" $results)
}
fn req [d @args]{
if $use_dig {
digr $d $@args
} else {
drillr $d $@args
}
}
fn digs [s d]{ fn digs [s d]{
echo (styled $s bright-yellow) echo (styled $s bright-yellow)
digr $d $s req $d $s
} }
fn digd [d]{ fn digd [d]{
@ -60,7 +81,7 @@ fn digall [@_args]{
digs $s $d digs $s $d
} $servers } $servers
} else { } else {
digr $d req $d
} }
} }