File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1453,6 +1453,17 @@ startServerMonitor() {
1453
1453
start () {
1454
1454
local EULA PID SERVER_COMMAND WORLD_DIR
1455
1455
WORLD_DIR=" $WORLDS_LOCATION /$1 "
1456
+
1457
+ # Pre-start Hook script execution
1458
+ PRE_START_HOOK=" $WORLD_DIR /hooks/pre-start.sh"
1459
+ if [ -x " $PRE_START_HOOK " ]; then
1460
+ printf " Executing pre-start hook script for world %s...\n" " $1 "
1461
+ " $PRE_START_HOOK "
1462
+ if [ $? -ne 0 ]; then
1463
+ printf " Warning: pre-start hook script for world %s exited with a non-zero status.\n" " $1 "
1464
+ fi
1465
+ fi
1466
+
1456
1467
# Make sure that the server software exists.
1457
1468
updateServerSoftware " $1 "
1458
1469
# Make sure that the world's directory exists.
@@ -1566,6 +1577,16 @@ start() {
1566
1577
# @param 1 The world server to stop.
1567
1578
# ---------------------------------------------------------------------------
1568
1579
stop () {
1580
+ # Pre-stop Hook script execution
1581
+ PRE_STOP_HOOK=" $WORLDS_LOCATION /$1 /hooks/pre-stop.sh"
1582
+ if [ -x " $PRE_STOP_HOOK " ]; then
1583
+ printf " Executing pre-stop hook script for world %s...\n" " $1 "
1584
+ " $PRE_STOP_HOOK "
1585
+ if [ $? -ne 0 ]; then
1586
+ printf " Warning: pre-stop hook script for world %s exited with a non-zero status.\n" " $1 "
1587
+ fi
1588
+ fi
1589
+
1569
1590
# Stop the server monitor if it is running.
1570
1591
stopServerMonitor $1
1571
1592
# Tell the server to stop.
You can’t perform that action at this time.
0 commit comments