-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f2fcc3
commit e50310e
Showing
2 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/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 | ||
;; | ||
*) | ||
# Start script unknown option | ||
;; | ||
esac | ||
done | ||
|
||
if screen -list | grep -q ${SCREEN}; then | ||
screen -X -S ${SCREEN} quit | ||
echo "SERVER_STOPPING" | ||
else | ||
echo "SERVER_OFFLINE" | ||
fi |