File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1549,8 +1549,17 @@ start() {
15491549 echo $PID > " $WORLDS_LOCATION /$1 .pid"
15501550 # Start the server crash monitor, if enabled.
15511551 startServerMonitor $1
1552- }
15531552
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+ }
15541563# ---------------------------------------------------------------------------
15551564# Stop the world server.
15561565#
@@ -1578,6 +1587,16 @@ stop() {
15781587 fi
15791588 # Remove the PID file for the world server.
15801589 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
15811600}
15821601
15831602# ---------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments