Hi there. I am trying to write a script for a server to mount a share. This means not manually clicking ‘ok’ if the share I am trying to mount is offline. I’ve put together the below but the script is returning the packet details in a new window instead of just passing to the next part of the script. Attached what the script is returning below.
What I need it to do is test if the Ip adress exists and if so mount the share if its not already mounted.
http://dl.dropbox.com/u/6790294/Screen%20shot%202012-04-11%20at%2010.42.56%20AM.png
set IP_Address to "xx.x.xx.xxx"
repeat while (do shell script "ping -c 2 -q " & IP_Address) contains "100% packet loss"
delay 5
end repeat
-- end test if sfnas exists
tell application "Finder"
set theVOLUMES to every disk in desktop
end tell
try
set theExistingVolumes to {}
on error
{}
end try
--make a list of all the volume names
try
repeat with i in theVOLUMES
set a to name of i
set end of theExistingVolumes to a
end repeat
on error
{}
end try
if "share" is not in theExistingVolumes then
repeat until "share" is in theExistingVolumes
try
mount volume "smb://adress/share"
end try
end repeat
end if