wakeup server before mounting - roubles/macmounter GitHub Wiki

Following up on the example from basic example, there may be some housekeeping required for the ping to succeed. This can be specified in WAKE_CMD.

WAKE_ATTEMPTS specifies how many times we try to wake the remote server.

One common example is having a NAS server that goes to sleep with inactivity. And you might need to send it a Wake-On-LAN packet to wake it up.

[example.com]
MOUNT_TEST_CMD=ls -l /Volumes/example && /sbin/mount | grep -q example
WAKE_CMD=/usr/local/bin/wakeonlan
WAKE_ATTEMPTS=5
PING_CMD=/sbin/ping -q -c3 -o example.com
PRE_MOUNT_CMD=/bin/mkdir -p /Volumes/example
MOUNT_CMD=/sbin/mount -t smbfs //[email protected]/remotefolder /Volumes/example