-
Notifications
You must be signed in to change notification settings - Fork 109
/
Copy pathstart_server
executable file
·66 lines (50 loc) · 1.33 KB
/
start_server
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
63
64
65
#!/bin/bash
function showHelp()
{
echo "Usage: [sudo] ./start_server.sh [OPTIONS]"
echo "Options:"
echo -e "\t -v , --version \t\t show GameBox Cloud Core version"
echo -e "\t -h , --help \t\t show this help"
echo -e "\t --debug \t\t start GameBox Cloud Core in debug mode."
echo "In default, GameBox Cloud Core will start in release mode, or else it will start in debug mode when you specified \"--debug\"."
echo ""
}
ROOT_DIR=$(cd "$(dirname $0)" && pwd)
source $ROOT_DIR/bin/shell_func.sh
if [ $? -ne 0 ] ; then echo "Terminating..." >&2; exit 1; fi
if [ $OS_TYPE == "MACOS" ]; then
ARGS=$($ROOT_DIR/bin/getopt_long "$@")
else
ARGS=$(getopt -o vh --long debug,version,help -n 'Start GameBox Cloud Core' -- "$@")
fi
eval set -- "$ARGS"
declare -i DEBUG=0
while true ; do
case "$1" in
--debug)
DEBUG=1
shift
;;
-v|--version)
echo $VERSION
echo ""
exit 0
;;
-h|--help)
showHelp;
echo ""
exit 0
;;
--) shift; break ;;
*)
echo "invalid option. $1"
exit 1
;;
esac
done
echo -e "\033[33mStart GameBox Cloud Core $VERSION\033[0m"
echo ""
updateConfigs
startSupervisord
sleep 3s
checkStatus