File tree 1 file changed +20
-1
lines changed
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -1549,8 +1549,17 @@ start() {
1549
1549
echo $PID > " $WORLDS_LOCATION /$1 .pid"
1550
1550
# Start the server crash monitor, if enabled.
1551
1551
startServerMonitor $1
1552
- }
1553
1552
1553
+ # Hook script execution
1554
+ HOOK_SCRIPT=" $WORLD_DIR /hooks/post-start.sh"
1555
+ if [ -x " $HOOK_SCRIPT " ]; then
1556
+ printf " Executing post-start hook script for world %s...\n" " $1 "
1557
+ " $HOOK_SCRIPT "
1558
+ if [ $? -ne 0 ]; then
1559
+ printf " Warning: post-start hook script for world %s exited with a non-zero status.\n" " $1 "
1560
+ fi
1561
+ fi
1562
+ }
1554
1563
# ---------------------------------------------------------------------------
1555
1564
# Stop the world server.
1556
1565
#
@@ -1578,6 +1587,16 @@ stop() {
1578
1587
fi
1579
1588
# Remove the PID file for the world server.
1580
1589
rm -f " $WORLDS_LOCATION /$1 .pid"
1590
+
1591
+ # Hook script execution
1592
+ HOOK_SCRIPT=" $WORLDS_LOCATION /$1 /hooks/post-stop.sh"
1593
+ if [ -x " $HOOK_SCRIPT " ]; then
1594
+ printf " Executing post-stop hook script for world %s...\n" " $1 "
1595
+ " $HOOK_SCRIPT "
1596
+ if [ $? -ne 0 ]; then
1597
+ printf " Warning: post-stop hook script for world %s exited with a non-zero status.\n" " $1 "
1598
+ fi
1599
+ fi
1581
1600
}
1582
1601
1583
1602
# ---------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments