From c58aa7f20d2c1440b1896f4e90a2bea66baa4423 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Fri, 12 Mar 2021 02:39:13 -0500 Subject: improve scan_network() --- penme | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/penme b/penme index 1a46e6c..af50ad5 100755 --- a/penme +++ b/penme @@ -16,15 +16,11 @@ write() scan_network() { - arp-scan --localnet | + arp-scan -q --localnet | grep ' ' while read ip junk do - case "$ip" in - *.*.*.*) ;; - *) continue ;; - esac - vprintf 'ARP scan found IP: %s\n' "$ip" - ( grep -q " penme host key @ $ip\$" /root/.ssh/authorized_keys ) || echo $ip + vprintf 'ARP scan found IP: %s\n' "$ip" + grep -qF " penme host key @ $ip\$" /root/.ssh/authorized_keys || echo "$ip" done } -- cgit v1.2.3