forked from simylein/minecraft-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stop.sh
48 lines (34 loc) · 724 Bytes
/
stop.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
#!/bin/bash
# minecraft server stop script
# read server files
source server.settings
source server.functions
# parse arguments
ParseArgs "$@"
ArgHelp
# safety checks
RootSafety
ScriptSafety
# debug
Debug "executing $0 script"
# change to server directory
ChangeServerDirectory
# check for existance of executable
CheckExecutable
# look if server is running
CheckScreen
# prints countdown to screen
Countdown "stopping"
# server stop
Stop
# awaits server stop
AwaitStop
# force quit server if not stopped
ForceQuit
# output confirmed stop
Log "ok" "server successfully stopped" "${screenLog}"
Print "ok" "server successfully stopped"
# log to debug if true
Debug "executed $0 script"
# exit with code 0
exit 0