-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocal.automount.sshfs.template.plist
61 lines (44 loc) · 1.91 KB
/
local.automount.sshfs.template.plist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?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">
<!--
Install sshfs and FUSE for macOS.
sshfs: install with brew install sshfs
FUSE for macOS: download from https://osxfuse.github.io/
Create a directory for each mount.
(e.g. /Users/username/Remote/TEMPLATE)
Manual mount, assuming that you've created the above directory:
sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,volname=TEMPLATE_NAME_FOR_FINDER [email protected]:/PATH/TO/REMOTE/TARGET /Users/username/Remote/TEMPLATE
(as a reminder, the '-o volname=TEMPLATE' needs to go together as '-o' means 'the next parameter
is a setting for sshfs.)
Manual unmount:
umount -f /Users/username/Remote/TEMPLATE
Automate the process:
Edit the below file.
The <array> section is the separated out command line above.
volname should be what you want it to be named as in the Finder.
Place the resulting plist file in ~/Library/LaunchAgents and rename TEMPLATE
launchctl load local.automount.sshfs.TEMPLATE.plist
launchctl start local.automount.sshfs.TEMPLATE
launchctl stop local.automount.sshfs.TEMPLATE
launchctl unload local.automount.sshfs.TEMPLATE
-->
<plist version="1.0">
<dict>
<key>AbandonProcessGroup</key>
<true/>
<key>Label</key>
<string>local.automount.sshfs.TEMPLATE</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/sshfs</string>
<string>-o</string>
<string>reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,volname=TEMPLATE_NAME_FOR_FINDER</string>
<string>[email protected]:/PATH/TO/REMOTE/TARGET</string>
<string>/Users/username/Remote/TEMPLATE</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>