Created
July 25, 2023 11:56
-
-
Save niklasdewally/2128525ab082ba725452f47e94da0420 to your computer and use it in GitHub Desktop.
Mac Automount with sshfs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>local.mount-<name></string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>PATH TO SERVICE SCRIPT</string> | |
| </array> | |
| <key>KeepAlive</key> | |
| <true/> | |
| <key>RunAtLoad</key> | |
| <true/> | |
| </dict> | |
| </plist> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| MOUNT_LOCATION=/Users/niklas/mnt/storage | |
| SSH_CONFIG=/Users/niklas/.ssh/config | |
| [email protected]: | |
| VOLNAME="My storage box" | |
| mkdir -p MOUNT_LOCATION | |
| # -f = run in foreground. Allows launchd to know when this process crashes, so it can start a new one. | |
| /usr/local/bin/sshfs "$SERVER" "$MOUNT_LOCATION" -f -F "$SSH_CONFIG" -oauto_cache,reconnect,local,volname="$VOLNAME",allow_other,defer_permissions,noappledouble |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment