Skip to content

Instantly share code, notes, and snippets.

@tofumatt
Created January 2, 2016 20:09
Show Gist options
  • Save tofumatt/e6ee2cde27ee96362267 to your computer and use it in GitHub Desktop.
Save tofumatt/e6ee2cde27ee96362267 to your computer and use it in GitHub Desktop.
Applescript App to check connection status to NAS and reconnect every 30 seconds
tell application "Finder"
set serverName to "Bookshelf"
set mediaName to "Media"
set publicName to "Public"
set isConnectedToMedia to disk mediaName exists
set isConnectedToPublic to disk publicName exists
end tell
if isConnectedToMedia = false then
try
mount volume mediaName on server serverName
end try
end if
if isConnectedToPublic = false then
try
mount volume publicName on server serverName
end try
end if
return 30
end idle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment