Last active
April 29, 2019 22:18
Revisions
-
plattrap revised this gist
Apr 29, 2019 . 1 changed file with 0 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,10 +27,6 @@ EOF #echo $type :: $key } for ADDRESS in $ADDRESSES do NAME=`wbinfo --WINS-by-ip=${ADDRESS} 2>/dev/null | cut -f2` -
plattrap revised this gist
Apr 29, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ #!/usr/bin/env bash ADDRESSES=`sudo arp-scan --localnet --ignoredups --interface=enp0s25 | grep $'\t' | cut -f1` #echo $ADDRESSES -
plattrap revised this gist
Apr 29, 2019 . No changes.There are no files selected for viewing
-
plattrap revised this gist
Apr 29, 2019 . No changes.There are no files selected for viewing
-
plattrap created this gist
Apr 29, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ #!/usr/bin/env bash ADDRESSES=`sudo arp-scan --localnet --ignoredups --interface=enp0s25 | grep 172. | cut -f1` #echo $ADDRESSES get_ssh_info () { local out err { out=( $(ssh-keyscan -t ed25519 $1 2>/dev/fd/3) ) err=( $(cat<&3) ) } 3<<EOF EOF if [[ -z ${out[2]} ]]; then key="" else key=${out[2]} fi if [[ ${err[2]} == "Connection" ]]; then host_type="refused" else host_type="${err[2]} ${err[3]}" fi #echo $type :: $key } #get_ssh_info pi-master #exit for ADDRESS in $ADDRESSES do NAME=`wbinfo --WINS-by-ip=${ADDRESS} 2>/dev/null | cut -f2` if [[ -z "$NAME" ]]; then NAME="-" fi NAME1=`avahi-resolve-address ${ADDRESS} 2>/dev/null | cut -f2` if [[ -z "$NAME1" ]]; then NAME1="-" fi get_ssh_info $ADDRESS printf "%-15s | %-15s | %-30s | %-8s | %s\n" $ADDRESS $NAME $NAME1 "${key:(-8)}" "$host_type" done echo