-
Notifications
You must be signed in to change notification settings - Fork 7
basic example
Before macmounter performs a mount, it is beneficial to quickly test if the remote folder is already mounted. If the remote folder is already mounted, there is no need to do anything else. For this reason, it is recommended to specify a MOUNT_TEST_CMD.
In this example, we will mount a remote folder called 'remotefolder' from the remote server 'example.com' on to the local folder '/Volumes/example'.
Notice, we specify a MOUNT_TEST_CMD. If the remote folder already exists, then macmounter will not re attempt the mount.
Next, notice, we specify a PING_CMD. This can be anything to test that we have accessibility to the remote server 'example.com'
Next, once we know we have accessibility to 'example.com' we can begin the mount. However, there may be some house keeping we need to do before we do the mount. This is where PRE_MOUNT_CMD comes in. In PRE_MOUNT_CMD in this example we create the local folder where we will mount 'example.com:/remotefolder'
Finally, we specify the command that actually does the mount.
[example.com]
MOUNT_TEST_CMD=/sbin/mount | grep -q example
PING_CMD=/sbin/ping -q -c3 -o example.com
PRE_MOUNT_CMD=/bin/mkdir -p /Volumes/example
MOUNT_CMD=/sbin/mount -t smbfs //roubles@example.com/remotefolder /Volumes/example