Añadir 'lookup.sh'

With the command _host_ we don't need two files to make the resolutions
This commit is contained in:
borekon 2022-10-28 06:26:06 +00:00
parent 46c57f4ac1
commit 3b640825b4

20
lookup.sh Normal file
View File

@ -0,0 +1,20 @@
#!/bin/bash
if [ -z "$1" ]
then
echo "You must specify a filename to read from"
exit 1;
fi
if [ ! -f "$1" ]
then
echo "File $1 does not exist or is not a file"
exit 1;
fi
while read ip n
do
if [ -z "$2" ]
then
echo $(host "$ip")
else
echo $(host "$ip" "$2")
fi
done < $1