Created
October 31, 2015 14:28
-
-
Save Qs-F/7c5c00d7617d39fd064e to your computer and use it in GitHub Desktop.
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/bash | |
# | |
# chkconfig: 2345 86 16 | |
# descripton: go web server | |
# processname: gowebserver | |
# pidfile: none | |
# config: none | |
# | |
# source function library | |
. /etc/rc.d/init.d/functions | |
PATH=$PATH:/usr/local/gowebserver | |
PROG=/usr/local/gowebserver/gowebserver | |
PROGNAME=`basename $PROG` | |
[ -f $PROG ] || exit 0 | |
case "$1" in | |
start) | |
echo -n $"Starting $PROGNAME: " | |
daemon $PROG | |
echo | |
;; | |
stop) | |
echo -n $"Stopping $PROGNAME:" | |
killproc $PROGNAME | |
echo | |
;; | |
status) | |
status $PROGNAME | |
;; | |
restart) | |
echo -n $"Stopping $PROGNAME:" | |
killproc $PROGNAME | |
echo | |
echo -n $"Starting $PROGNAME: " | |
daemon $PROG | |
echo | |
;; | |
*) | |
echo $"Usage: $PROGNAME {start|stop|status|restart}" >&2 | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment