Mount Eagle Script/Application


Quick walk through of making the Mount Eagle Script script for mounting the Eagle NAS to a user's home directory.

1) Home Directory Setup


Create a directory called 'web' in your home directory. This will be the mount point for the NAS, don't put anything in this folder.
You could name it whatever you want, but this was easiest. Also, you would have to change the script if you changed this folder name.

2) Script

The script has already been created and is setup in the /Applications folder, this part and the next is just in case you need to do it again or
make another script.

Open up the AppleScript Editor (/Applications/Utilities)

Here is the script used.
tell application "Terminal"
 activate
 tell application "System Events" to set frontmost of process "Terminal" to true
 set shell to do script "mount_afp -i afp://128.95.149.81/web ~/web" in window 1
end tell

Basic run down of script.
tell application "Terminal"
 activate
Tells the script to use Terminal and turn it on.

 tell application "System Events" to set frontmost of process "Terminal" to true
Bring the Terminal to the foreground so it isn't hidden or something.

 set shell to do script "mount_afp -i afp://128.95.149.81/web ~/web" in window 1
end tell
Runs the mount command, which is specific to Eagle, and tells it to mount to the directory web in our home folder. It also specifies to use the current Terminal window instead of creating a new one to run the script in.

3) Save and Run

Now save the script as an Application. In this case we saved it to /Applications, so any user can use it.
Now just double click the application and it will launch.

4) Extra Bonus

Add it to your Login Items via System Preferences->Users & Groups->Select User->Login Items
It will then run when the user logs into the computer.

The NAS can now be accessed by any user, who have used the script, with the path as follows.
/Users/<username>/web