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

View File

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