You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Joey Hines 29087013b5 Merge pull request 'Some nits' (#1) from Etzelia/restart-script:stuff into master 1 year ago
.gitignore Some nits 1 year ago
LICENSE Initial commit 1 year ago
README.md Some nits 1 year ago
requirements.txt Initial commit 1 year ago
server-restart.py Some nits 1 year ago

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 $SCREEN_NAME; then    
    screen -dmS $SCREEN_NAME    
fi                      
                        
# Run the startup script in a screen    
screen -S $SCREEN_NAME -p 0 -X stuff "^Mcd $SERVER_DIRECTORY^M"    
screen -S $SCREEN_NAME -p 0 -X stuff "./$STARTUP_SCRIPT^M"