Skip to content

Instantly share code, notes, and snippets.

@cuixin
Created September 23, 2014 05:27
Show Gist options
  • Select an option

  • Save cuixin/0f241cb6672902176a80 to your computer and use it in GitHub Desktop.

Select an option

Save cuixin/0f241cb6672902176a80 to your computer and use it in GitHub Desktop.
goagent service script.
#!/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