1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE plist PUBLIC
"-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
6 <string>me.Galaxy.AutoSSHem1
</string>
8 <string>Galaxy
</string>
9 <key>EnvironmentVariables
</key>
11 <key>AUTOSSH_POLL
</key>
14 <string>/Users/Galaxy/Dropbox/Galaxy/dotfiles/ssh/GalaxyMini
</string>
16 <string>-o ServerAliveInterval=
59 -N
</string>
17 <key>NoHostKeyCheck
</key>
18 <string>-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
</string>
22 <key>ProgramArguments
</key>
24 <string>/bin/bash
</string>
27 RandomPort='RANDOM %
64000 +
1024'; \
29 /usr/local/bin/autossh -M $(($RandomPort)) -f galaxy@
2403:
3a00:
202:
1129:
49:
212:
210:
128 -p
26386 -C -D7575 $COMMONARG; \
30 /usr/local/bin/autossh -M $(($RandomPort)) -f luolab@eeb-zhanglab.eeb.lsa.umich.edu -C -D8000 $COMMONARG; \
38 <key>SuccessfulExit
</key>
41 <key>StandardOutPath
</key>
42 <string>/Library/Logs/me.Galaxy.AutoSSHem.log
</string>
43 <key>StandardErrorPath
</key>
44 <string>/Library/Logs/me.Galaxy.AutoSSHem.log
</string>
49 https://github.com/tjluoma/launchd-keepalive
50 https://github.com/grinnan/grintun/blob/master/LaunchDaemons/local.autotunnel.autossh.plist
52 ### Put me in /Library/LaunchDaemons/ as it is "System-wide daemons provided by the administrator". Remember to "sudo chown root:wheel".
53 sudo launchctl unload /Library/LaunchDaemons/me.Galaxy.AutoSSHem1.plist
54 sudo cp me.Galaxy.AutoSSHem1.plist /Library/LaunchDaemons/
55 sudo launchctl load /Library/LaunchDaemons/me.Galaxy.AutoSSHem1.plist
57 sudo launchctl start me.Galaxy.AutoSSHem1
58 sudo launchctl stop me.Galaxy.AutoSSHem1
59 ps -ef|grep autossh|awk '{print $2}'|xargs sudo kill -9
61 sudo rm /Library/Logs/me.Galaxy.AutoSSHem.log