NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
nd
Dec 08, 2008Aspirant
AFP auto mount on ReadyNAS startup (OSX 10.5.5)
Hi there Is it possible to get some of the shares automatically mounted, when the NAS ist started up? Or even better as soon as the ReadyNas is visible in the Finder? This would also allow me to conn...
Earl0101
Jul 31, 2009Aspirant
In case anyone is interested in auto mount using a script, I have been using the script below successfully.
I've created one for each share that I frequently use and run it as 'login item' per the instructions.
For shares I use less frequently I run the created application only when I need it
Earl
I've created one for each share that I frequently use and run it as 'login item' per the instructions.
For shares I use less frequently I run the created application only when I need it
Earl
---------------------------------------------------------------------
(* This script will provide the needed User and password information
to Mount any desired NAS share without a dialog box.
To use:
1) Cut and past this script into the Apple "Script Editor" application
2) Set the name variables NAS_Location, NAS_share, NAS_user, NAS_pw,
User_LongName, and User_boot according to the instructions provided
3) Under the File menu choose "Save As"
4) Select File Format: Application
5) Check-box for "Run Only" and uncheck any other boxes ** see warning below **
6) Choose location (& new name if desired) to put application
7) Click Save
For automatic mounting at login:
1) In Finder, open System Preferences
2) Select Accounts
3) Select the Login item tab
4) Click + and add the application
**********************************************************
** WARNING **
** If you don't use "Run Only" Other users will be able **
** to use the Script Editor to see your password. **
** WARNING **
** If anyone gets a hold of this application they may have access to the **
** share with all privileges of the user/password combo you entered **
** by renaming their HD and creating a equivalent username! **
** (remove "as user name NAS_user with password NAS_pw" to disable) **
** WARNING **
**********************************************************
*)
set NAS_Location to "afp://192.168.1.xxx/" -- Location of NAS (in this cas the IP address... but can also use format: "afp://NASname.local./share_name" with desired 'NASname' and 'share_name' )
set NAS_share to "name_of_share" -- NAS share to mount (see "Shares listings" below "Shares" selection in "ReadyNAS Frontview" GUI; pick a Share Name you want to mount)
-- *** The name and password below essentially are coded into the script; this shouldn't be an issue if you are the only one with access to the file...
set NAS_user to "myname" -- ReadyNAS user/Group name to use (see "User & group Accounts" below "Security" selection in "ReadyNAS Frontview" GUI; pick a Name with proper access)
set NAS_pw to "mypassword" -- ReadyNAS user password to use corresponding to Name selected above
-- The two items below attempt to make the script somewhat safer in that it will only run if the specified user is logged in utilizing the specified startup disk
set User_LongName to "SysUser" -- Apple name of desired user allowed run the application (Select "System preferences" from the apple menu and pick "Accounts": see the name listed next to "User Name:")
set User_boot to "SysBoot" -- Apple name of boot volume at run time (Select "About this Mac" from the apple menu and see the name listed next to "Startup Disk")
set rtn to "
"
---------------------------------------------------------------------------------
set SystemInfoList to system info
set runTime_ShortName to short user name of SystemInfoList
set runTime_LongName to long user name of SystemInfoList
set runTime_boot to boot volume of SystemInfoList
set NAS_vol to NAS_Location & NAS_share
-- display dialog "Long name: " &c_LongName &rtn &"boot: " &c_boot &rtn&rtn "Long name: " &User_LongName &rtn &"boot: " &User_boot buttons {"Cancel"}
get system info
if runTime_LongName is equal to User_LongName then
if runTime_boot is equal to User_boot then
if (list disks) does not contain NAS_share then
try
mount volume NAS_vol as user name NAS_user with password NAS_pw
on error number errorNumber
-- it didn't happen (Finder will alert user)
end try
end if
else
display dialog "(bt) " & rtn & "File deleted for" & rtn & runTime_LongName & " on " & runTime_boot& "/" & User_boot & rtn buttons {"OK"}
return
end if
else
display dialog "(nm) " & rtn & "File deleted for" & rtn & runTime_LongName & "/" & User_LongName & " on " & runTime_boot & rtn buttons {"OK"}
return
end if
on quit
continue quit
end quit
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!