Merge branch 'func_hostip' of skyfall/tab-sorcery into dev

pull/4/head
Aaron Johnson 7 years ago committed by Gitea
commit 753d1aa184

@ -8,6 +8,11 @@
scan_domain=$1 scan_domain=$1
scan_ns=$2 scan_ns=$2
get_hostip () {
#host_ip=`echo $zone_xfer | grep ${host} | grep A | awk '{print $3}'`
host_ip=`echo $zone_xfer | grep $1 | grep A | awk '{print $3}'`
}
zone_xfer=`dig $scan_domain @$scan_ns AXFR | egrep -v 'SOA|NS|MX|DiG' | grep $scan_domain | awk '{print $1,$4,$5}'` zone_xfer=`dig $scan_domain @$scan_ns AXFR | egrep -v 'SOA|NS|MX|DiG' | grep $scan_domain | awk '{print $1,$4,$5}'`
for host in `echo $zone_xfer | awk '{print $1}'`; do for host in `echo $zone_xfer | awk '{print $1}'`; do
user_name=$3 user_name=$3
@ -16,22 +21,23 @@ for host in `echo $zone_xfer | awk '{print $1}'`; do
if echo $zone_xfer | grep $host | grep TXT; then if echo $zone_xfer | grep $host | grep TXT; then
if [ "`echo $zone_xfer | grep $host | grep TXT | awk '{print $3}'`" = '"lxc"' ]; then if [ "`echo $zone_xfer | grep $host | grep TXT | awk '{print $3}'`" = '"lxc"' ]; then
user_name="root" user_name="root"
host_ip=`echo $zone_xfer | grep ${host} | grep A | awk '{print $3}'` get_hostip ${host}
alias ${host_short}="${connect_cmd} ${user_name}@${host_ip}" alias ${host_short}="${connect_cmd} ${user_name}@${host_ip}"
elif [ "`echo $zone_xfer | grep $host | grep TXT | awk '{print $3}'`" = '"windows"' ]; then elif [ "`echo $zone_xfer | grep $host | grep TXT | awk '{print $3}'`" = '"windows"' ]; then
connect_cmd="rdesktop -g 1600x900" connect_cmd="rdesktop -g 1600x900"
host_ip=`echo $zone_xfer | grep ${host} | grep A | awk '{print $3}'` get_hostip ${host}
alias ${host_short}="${connect_cmd} -u ${user_name} ${host_ip}" alias ${host_short}="${connect_cmd} -u ${user_name} ${host_ip}"
elif [ "`echo $zone_xfer | grep $host | grep TXT | awk '{print $3}'`" = '"cisco"' ]; then elif [ "`echo $zone_xfer | grep $host | grep TXT | awk '{print $3}'`" = '"cisco"' ]; then
connect_cmd="telnet" connect_cmd="telnet"
host_ip=`echo $zone_xfer | grep ${host} | grep A | awk '{print $3}'` get_hostip ${host}
alias ${host_short}="${connect_cmd} ${host_ip}" alias ${host_short}="${connect_cmd} ${host_ip}"
fi fi
else else
host_ip=`echo $zone_xfer | grep $host | grep A | awk '{print $3}'` get_hostip ${host}
alias ${host_short}="${connect_cmd} ${user_name}@${host_ip}" alias ${host_short}="${connect_cmd} ${user_name}@${host_ip}"
fi >/dev/null fi >/dev/null
done done
unset -f get_hostip
return 0 return 0

Loading…
Cancel
Save