Go to file
Joey Hines a8e12cc8bd
Initial commit
2021-07-25 16:05:56 -06:00
LICENSE Initial commit 2021-07-25 16:05:56 -06:00
README.md Initial commit 2021-07-25 16:05:56 -06:00
requirements.txt Initial commit 2021-07-25 16:05:56 -06:00
server-restart.py Initial commit 2021-07-25 16:05:56 -06:00

README.md

Server Restart Script

Hooks into ServerAPI to run the restart command on the server. A restart script must be specified in spigot.yml for this work.

Example Restart Script

#!/bin/bash        

SCREEN_NAME="server"
SERVER_DIRECTORY="/home/minecraft/server"
STARTUP_SCRIPT="startup.sh"     
                        
# Start the screen if it is not already running    
if ! screen -list | grep -q $SCREE_NAME; then    
    screen -dmS s1_canopy    
fi                      
                        
# Run the startup script in a screen    
screen -S s1_canopy -p 0 -X stuff "^Mcd $SCREEN_DIRECTORY^M"    
screen -S s1_canopy -p 0 -X stuff "./$STARTUP_SCRIPT^M"