Created
September 23, 2014 05:27
-
-
Save cuixin/0f241cb6672902176a80 to your computer and use it in GitHub Desktop.
goagent service script.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # goagent service by Steven | |
| # put this file in /etc/init.d/goagent | |
| # sudo update-rc.d goagent defaults | |
| start(){ | |
| echo "start goagent" | |
| sudo /home/steven/work/github.com/goagent/local/proxy.sh start | |
| exit 0 | |
| } | |
| stop(){ | |
| echo "stop goagent" | |
| sudo /home/steven/work/github.com/goagent/local/proxy.sh stop | |
| } | |
| restart(){ | |
| echo "restart goagent" | |
| stop | |
| start | |
| } | |
| case "$1" in | |
| start) | |
| start | |
| ;; | |
| stop) | |
| stop | |
| ;; | |
| restart) | |
| restart | |
| ;; | |
| *) | |
| echo "usage:$0 start|stop|restart" | |
| exit 0; | |
| esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment