码迷,mamicode.com
首页 > 其他好文 > 详细

启动脚本gameserver

时间:2017-06-19 22:15:10      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:启动脚本   gameserver   

其实很菜的哈哈

#!/bin/bash
#gj game server start procedure
#xcn qq:995345781
#version 2.0
PATH_DIR=/application/game/game002
prog=game002
start() {
	[ "$EUID" != "0" ] && exit 4
	cd /application/game/game002/
	./game002 -d
	echo -n $"starting $prog:"
	if [ "$?" -ne 0 ]
	then
		echo "start erro"
	fi
}

stop() {
	[ "$EUID" != "0" ] && exit 4
	echo -n $"stoping down $prog:"
	kill `cat $PATH_DIR/server.pid`
}

case "$1" in
	start)
		start
		;;
	stop)
		stop
		;;
	*)
	echo $"usage:$0 {start|stop}"
	exit 2
esac


本文出自 “小菜鸟” 博客,请务必保留此出处http://baishuchao.blog.51cto.com/12918589/1939993

启动脚本gameserver

标签:启动脚本   gameserver   

原文地址:http://baishuchao.blog.51cto.com/12918589/1939993

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!