-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.sh
executable file
·62 lines (55 loc) · 1.04 KB
/
server.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/sh
DAPP_ROOT_DIR=`dirname $0`
SCRIPTS_DIR=${DAPP_ROOT_DIR}/scripts/unix
UNAME=`uname`
PLATFORM=unknow
# Mac
if [ $UNAME = "Darwin" ] ; then
echo "Platform: Darwin"
PLATFORM=Darwin
# Linux
elif [ $UNAME = "Linux" ] ; then
echo "Platform: Linux"
PLATFORM=Linux
fi
fun_start ()
{
${DAPP_ROOT_DIR}/script/start.sh
}
#fun_stop ()
#{
# ${DAPP_ROOT_DIR}/bin/$1 stop
#}
# 使用说明
fun_usage ()
{
echo ""
echo "用法: "
echo "$0 动作 [选项]"
echo "动作: "
echo " start 启动节点"
# echo " stop 停止节点"
echo ""
echo "选项: "
echo " -h, --help 显示本信息"
echo ""
}
# parse command line parameters
while [ $# -ne 0 ] ; do
PARAM=$1
shift
case ${PARAM} in
--) break ;;
--help|-h) fun_usage; exit 0;;
*) ARGS="${ARGS} ${PARAM}" ;;
esac
done
set -- ${ARGS}
ACTION=$1
shift
case ${ACTION} in
'') fun_usage;;
'start') fun_start $1;;
# 'stop') fun_stop $1;;
*) echo "参数错误!"; fun_usage; exit 1;;
esac