Re: check available remote machines? possible?
Re: check available remote machines? possible?
- Subject: Re: check available remote machines? possible?
- From: Gnarlodious <email@hidden>
- Date: Wed, 30 Nov 2005 22:51:46 -0700
- Thread-topic: check available remote machines? possible?
Title: Re: check available remote machines? possible?
Here’s a script I wrote to accomplish the task. Note that the wait time is set to 12 seconds. You can also tweak your start and end IP numbers according to your router’s settings.
set startIP to 2
set endIP to 20
set IPbase to do shell script "arp -a | sed -n '/1)/{p;q;}' | sed 's|.* (\\(.*\\).1) .*|\\1.|' "
set pingTemp to "/tmp/pingtemp"
do shell script ": > " & pingTemp
repeat with i from startIP to endIP
set theIP to IPbase & i
do shell script "ping -c 1 -q " & theIP & " >> " & pingTemp & " 2>&1 &"
end repeat
delay 12
set ipText to do shell script "awk '/^PING/{ip=$2}$NF==\"ms\"{split($(NF-1),t,\"/\");printf \"%s = %s ms\\n\",ip,t[1]}' " & pingTemp
tell application "Finder" to set frontApp to (the name of (the path to the «constant afdregfp»))
beep
tell application frontApp to display dialog the ipText with icon note buttons {"OK"} default button 1
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden