Automator - Connect to Server at Startup based on MAC Address

The solution was to add a short shell script in the Automator application to get the IP address based on the MAC address.

ip_address=$(arp -a | grep "YOUR_MAC_ADDRESS" | cut -d "(" -f2 | cut -d ")" -f1)

url_beginning="afp://"

url_end="/YOUR_USER_NAME"

url="$url_beginning$ip_address$url_end"

echo $url

The code above will get the IP address (example: 10.0.0.5) of the device with the YOUR_MAC_ADDRESS MAC Address (example: 0:10:75:57:13:22). Then it will concatenate the correct URL (example: afp://10.0.0.5/YOUR_USER_NAME) and connect it as shown in the image below.

enter image description here