-
Notifications
You must be signed in to change notification settings - Fork 6
/
start.sh
56 lines (50 loc) · 1.07 KB
/
start.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
#!/usr/bin/env bash
#| Script Version (2019.1.10)
#| Script Author Jan Heil
#| Script Website www.byte-store.de
#
# Default example Script from center.byte-store.de
# Language English
#
SERVER_STARTBINARY_JAVA="DiscordBot.jar"
SERVER_STARTBINARY_JS="index.js"
for i in "$@"
do
case ${i} in
-s=*|--screen=*)
SCREEN="${i#*=}"
shift # Server Screen Name
;;
-l=*|--language=*)
LANGUAGE="${i#*=}"
shift # Server Language
;;
-b=*|--binary=*)
BIN="${i#*=}"
shift # Server Path
;;
*)
# Start script unknown option
;;
esac
done
if ! screen -list | grep -q ${SCREEN}; then
if [ ${LANGUAGE} == "java" ]; then
if test -f "$BIN$SERVER_STARTBINARY_JAVA"; then
screen -SL ${SCREEN} -Logfile ./triox-server.log java -jar "$BIN$SERVER_STARTBINARY_JAVA"
else
echo "SERVER_BINARY"
exit 1
fi
else
if test -f "$BIN$SERVER_STARTBINARY_JS"; then
screen -SL ${SCREEN} -Logfile ./triox-server.log node "$BIN$SERVER_STARTBINARY_JS"
else
echo "SERVER_BINARY"
exit 1
fi
fi
echo "SERVER_STARTING"
else
echo "SERVER_ONLINE"
fi