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.AutoSSHem2
</string>
8 <string>Galaxy
</string>
9 <key>EnvironmentVariables
</key>
11 <key>AUTOSSH_POLL
</key>
14 <string>-o ServerAliveInterval=
59 -N
</string>
15 <key>LuoLabPorts
</key>
16 <string>-L8083:
192.168.0.83:
22 -L8059:
192.168.0.83:
5900 -L8005:
192.168.0.5:
22 -L8165:
192.168.0.165:
22 -L8003:
192.168.0.3:
22 -L20548:
192.168.0.3:
548 -L5000:
192.168.0.3:
5000 -L8202:
192.168.0.202:
443 -L8881:
192.168.0.1:
443 -R9922:localhost:
22 -D8632
21 <key>ProgramArguments
</key>
23 <string>/bin/bash
</string>
26 RandomPort='RANDOM %
64000 +
1024'; \
28 /usr/local/bin/autossh -M $(($RandomPort)) -f galaxy@lab.luo-lab.org $COMMONARG $LuoLabPorts; \
36 <key>SuccessfulExit
</key>
39 <key>StandardOutPath
</key>
40 <string>/Library/Logs/me.Galaxy.AutoSSHem.log
</string>
41 <key>StandardErrorPath
</key>
42 <string>/Library/Logs/me.Galaxy.AutoSSHem.log
</string>
47 https://github.com/tjluoma/launchd-keepalive
48 https://github.com/grinnan/grintun/blob/master/LaunchDaemons/local.autotunnel.autossh.plist
50 ### Put me in /Library/LaunchDaemons/ as it is "System-wide daemons provided by the administrator". Remember to "sudo chown root:wheel".
51 sudo launchctl unload /Library/LaunchDaemons/me.Galaxy.AutoSSHem2.plist
52 sudo cp me.Galaxy.AutoSSHem2.plist /Library/LaunchDaemons/
53 sudo launchctl load /Library/LaunchDaemons/me.Galaxy.AutoSSHem2.plist
55 sudo launchctl start me.Galaxy.AutoSSHem2
56 sudo launchctl stop me.Galaxy.AutoSSHem2
57 ps -ef|grep autossh|awk '{print $2}'|xargs sudo kill -9
59 sudo rm /Library/Logs/me.Galaxy.AutoSSHem.log