OS has a "neighborhood" that it names "Network" that shows up in the sidebar of the finder as the Shared tab. This contains the various machines on your LAN that OS X can see.

I'd like to know where, if anywhere, this maps to the physical disk. Basically, before I run a script, I want to know that the machine I am trying to access is actually available.

#!/bin/bash

MAIL=`ps -U"$USER" -co command | grep "\bMail\b"`
if [ "$MAIL" ]; then
        ssh cerebus.local cat .signature > $HOME/.signature
        MYSIG="$(<$HOME/.signature)"
        osascript <<EOF
tell application "Mail" to set content of signature "Fortune" to "-- " & return & "$MYSIG"
EOF
fi

This script works fine when the machine cerebus.local is there, but it doesn't work when it's not (it blanks the .signature file)

I'd like to be able to check for the server before I run the rest of the script (like I check if Mail is running before Doing anything else. The easiest thing would be to check if a file exists, which is why I am hoping there is some directory somewhere with a list of the machines on the Network.

 --
What is best in life? To crush your enemies, see them driven before you,
and to hear the lamentation of the women

_______________________________________________
MacOSX-talk mailing list
[email protected]
http://www.omnigroup.com/mailman/listinfo/macosx-talk

Reply via email to