Is there any way to programmatically check if a connection is established to an afp server? I have tried pinging the server but that always results in a timeout.
So far the only workaround that I've gotten to work is:
#!/bin/bash open "afp://website.com/afpDir/" until [[ -d /Volumes/afpDir/ ]]; do echo 'waiting for connections' sleep 1 done
However, this only works if I specifically check for the
afpDir directory while it is open in Finder. Is there a reliable way to to check if there is a connection to that afp server or perhaps even finding a reliable ip for the server?