modified: myjupyterlab.sh
[GalaxyCodeBases.git] / etc / Mac / me.Galaxy.AutoSSHem2.plist
blob5a0bd7962f5491991f9339378dc4f7e192464677
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">
3 <plist version="1.0">
4 <dict>
5 <key>Label</key>
6 <string>me.Galaxy.AutoSSHem2</string>
7 <key>UserName</key>
8 <string>Galaxy</string>
9 <key>EnvironmentVariables</key>
10 <dict>
11 <key>AUTOSSH_POLL</key>
12 <string>59</string>
13 <key>COMMONARG</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
17 </string>
18 </dict>
19 <key>Nice</key>
20 <integer>10</integer>
21 <key>ProgramArguments</key>
22 <array>
23 <string>/bin/bash</string>
24 <string>-c</string>
25 <string>
26 RandomPort='RANDOM % 64000 + 1024'; \
27 date; \
28 /usr/local/bin/autossh -M $(($RandomPort)) -f galaxy@lab.luo-lab.org $COMMONARG $LuoLabPorts; \
29 echo 2.;
30 </string>
31 </array>
32 <key>RunAtLoad</key>
33 <true/>
34 <key>KeepAlive</key>
35 <dict>
36 <key>SuccessfulExit</key>
37 <false/>
38 </dict>
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>
43 </dict>
44 <!--
45 Embed Version
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
60 -->
61 </plist>