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.AutoSSH
</string>
8 <string>Galaxy
</string>
9 <key>ProgramArguments
</key>
13 <string>/opt/Galaxy/myAutoSSH.sh
</string>
19 <key>NetworkState
</key>
21 <key>SuccessfulExit
</key>
26 https://github.com/tjluoma/launchd-keepalive
28 sudo cp myAutoSSH.sh /opt/Galaxy/
30 ### Put me in /Library/LaunchDaemons/ as it is "System-wide daemons provided by the administrator". Remember to "sudo chown root:wheel".
31 sudo launchctl unload /Library/LaunchDaemons/me.Galaxy.AutoSSH.plist
32 sudo cp me.Galaxy.AutoSSH.plist /Library/LaunchDaemons/
33 sudo launchctl load /Library/LaunchDaemons/me.Galaxy.AutoSSH.plist
35 sudo chown root:wheel /Library/LaunchDaemons/me.Galaxy.AutoSSH.plist /opt/Galaxy/myAutoSSH.sh
37 sudo launchctl start me.Galaxy.AutoSSH
38 sudo launchctl stop me.Galaxy.AutoSSH
39 ps -ef|grep autossh|awk '{print $2}'|xargs sudo kill -9