keeps an sshfs mount alive on a mac. point a launchd agent at it with a 60 second start interval and it makes sure a remote folder stays mounted, remounts when the connection dies, and cleans up dead mounts on its own.

the useful part is the liveness check. macfuse mounts can go zombie where the mount table says mounted and stat works but every real read hangs forever. so the script lists the mount root with a short timeout instead of trusting the mount table. it also wants two failed checks in a row before it force unmounts, so one slow tick on a flaky link does not cause a remount storm. a pid lock stops overlapping runs from fighting each other and a 45 second self kill stops a hung run from piling up.

to use it: edit the config block at the top, ssh alias, remote path, mountpoint. make the script executable and set up a launchd agent that runs it every minute. needs macfuse and sshfs installed. the timeout binary from coreutils is optional but recommended, without it the liveness check can hang until the self kill fires. everything it does goes to the logfile set in the config.