{"id":4085,"date":"2021-07-14T11:31:28","date_gmt":"2021-07-14T16:31:28","guid":{"rendered":"https:\/\/www.incredigeek.com\/home\/?p=4085"},"modified":"2021-07-14T11:32:21","modified_gmt":"2021-07-14T16:32:21","slug":"simple-ping-script-to-scan-a-24","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/simple-ping-script-to-scan-a-24\/","title":{"rendered":"Simple SH Ping script to scan a \/24"},"content":{"rendered":"\n<p>This is a very simple ping script I created to run on a remote UniFi device to scan for other IP addresses on it&#8217;s network.  It works on SH environments as well as Bash.<\/p>\n\n\n\n<p>Paste the script in a ping.sh file and then <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">chmod +x ping.sh<\/pre>\n\n\n\n<p>run like so, replacing 192.168.1. with the IP range you want to scan.<\/p>\n\n\n\n<p>sh ping.sh 192.168.1.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/sh\n# simple ping scan utility\n\n# i.e. 192.168.0.\nipFirstPart=$1\n\nip=0\nwhile &#91; $ip -ne 255 ] \ndo \n  ip=$(($ip+1))\n  ping -w1 $ipFirstPart${ip} | grep \"64 bytes from\"\ndone<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is a very simple ping script I created to run on a remote UniFi device to scan for other IP addresses on it&#8217;s network. It works on SH environments as well as Bash. Paste the script in a ping.sh &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/simple-ping-script-to-scan-a-24\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[266],"tags":[7,161,173,1235,1236],"class_list":["post-4085","post","type-post","status-publish","format-standard","hentry","category-scripts","tag-linux-2","tag-ping","tag-script","tag-sh","tag-utility"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4085","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=4085"}],"version-history":[{"count":2,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4085\/revisions"}],"predecessor-version":[{"id":4088,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4085\/revisions\/4088"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=4085"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=4085"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=4085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}