Skip to content

Instantly share code, notes, and snippets.

@lovemyliwu
Last active June 19, 2016 03:08
Show Gist options
  • Save lovemyliwu/d62aa122af177fe590a2b2ffd2d8f4b9 to your computer and use it in GitHub Desktop.
Save lovemyliwu/d62aa122af177fe590a2b2ffd2d8f4b9 to your computer and use it in GitHub Desktop.
Mac 开机自启动脚本 Ubuntu 开机自启动脚本

Ubuntu

sudo vi /etc/rc.local

cd some-where-your-shell-folder
./your-shell
cd -

mac

sudo vi /Library/LaunchDaemons/com.go.agent.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.go.agent</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/python</string>
<string>/Users/smite/Opt/linux-local/proxy.py</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>

sudo chown root:wheel /Library/LaunchDaemons/com.go.agent.plist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment