-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.sh
71 lines (61 loc) · 1.61 KB
/
demo.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
63
64
65
66
67
68
69
70
71
#!/bin/bash
# Powered By EndMove - https://www.endmove.eu/ - Jérémi N
# Version used: 1.0.0
SCREEN="demo" # The name of the screen of your minecraft server
NAME="demo" # The name of your minecraft server
START="java -Xincgc -Xms3024M -jar server.jar" # Startup command for your server
PREFIX="[EndServ]" # Prefix of the sh EndServ script
cd "/home/minecraft/demo/" # Emplacement de votre serveur minecraft conseillé "(~/home/minecraft/server_name/"
isrunning(){
if ! screen -list | grep -q "$SCREEN"
then
return 1
else
return 0
fi
}
case "$1" in
version)
echo "
$PREFIX is a creation of EndMove
You are using version: v1.0.0
"
;;
start)
if ( isrunning )
then
echo "$PREFIX : Server ($NAME) is already running!"
else
echo "$PREFIX : Starting server ($NAME)..."
screen -dmS $SCREEN $START
fi
;;
status)
if ( isrunning )
then
echo "$PREFIX : Server ($NAME) is running."
else
echo "$PREFIX : Server ($NAME) is not running."
fi
;;
screen)
screen -r $SCREEN
;;
reload)
screen -S $SCREEN -p 0 -X stuff `printf "reload\r"`
echo "$PREFIX : Server ($NAME) will be restarted."
;;
stop)
if ( isrunning )
then
screen -S $SCREEN -p 0 -X stuff `printf "stop\r"`
echo "$PREFIX : Stopping server ($NAME)."
else
echo "$PREFIX : Server ($NAME) is not running!"
fi
;;
*)
echo "$PREFIX Usage : {start|stop|status|screen|reload|version|help}"
;;
esac
exit 0