#!/bin/bash # Heads up if anyones actually playing at the time of the restart. # btw: `echo -ne '\015'` << sends "enter" screen -S mine -X stuff "broadcast Going down in 5m!"`echo -ne '\015'` sleep 200 screen -S mine -X stuff "save-all"`echo -ne '\015'` sleep 30 screen -S mine -X stuff "broadcast Going down in 60s! Will be back in a while."`echo -ne '\015'` sleep 30 screen -S mine -X stuff "broadcast Going down in 30s!"`echo -ne '\015'` sleep 15 screen -S mine -X stuff "broadcast Going down in 15s!"`echo -ne '\015'` sleep 15 screen -S mine -X stuff "broadcast Going down NOW!"`echo -ne '\015'` sleep 1 screen -S mine -X stuff "stop"`echo -ne '\015'` sleep 60 # Taring the world if anyone wants to download tar -zcf /home/mine/viewer/world.tar.gz /home/mine/minecraft/world/ # Overviewer! # Letting the server stay down while rendering. Not necessary. /home/mine/overviewer/render.sh sleep 30 # Getting a screen running that accepts -X stuff. # There's a known bug (since 2008) where the screen session must be attached at least once to be able # to receive commands through -X. # First we start one screen with the express purpose of starting another screen and then close. # The second screen is then detached and we have our once-detached-screen accepting -X stuff. Yay! screen -dmS tempmine bash -c "sleep 120" sleep 1 screen -S tempmine -X screen screen -dR mine /home/mine/minecraft/server.sh sleep 1 screen -S mine -X detach sleep 15 screen -S mine -X stuff "broadcast Aaaaaaand we are back!"`echo -ne '\015'`
Labels
- linux (21)
- script (15)
- css (12)
- bash (9)
- cli (9)
- customize (8)
- stylish (7)
- windows (6)
- firefox (5)
- userchrome.css (5)
- xbmc (5)
- ahk (3)
- autohotkey (3)
- command line (3)
- tt-rss (3)
- ubuntu (3)
- SQL (2)
- automation (2)
- batch (2)
- config (2)
- google reader (2)
- javascript (2)
- mpd (2)
- photos (2)
- spotify (2)
- virtualbox (2)
- API (1)
- GW2 (1)
- Guild Wars 2 (1)
- SQL Server (1)
- android (1)
- animals (1)
- arch linux (1)
- backup (1)
- bukkit (1)
- c# (1)
- cross browser (1)
- curl (1)
- debian (1)
- deluge (1)
- ext.net (1)
- facebook (1)
- flexget (1)
- flowers (1)
- gentoo (1)
- greasemonkey (1)
- kodi (1)
- openbox (1)
- pidgin (1)
- python (1)
- raspberry (1)
- rpi (1)
- scriptish (1)
- tasker (1)
- tellstick (1)
- tmux (1)
- update (1)
- video (1)
- youtube (1)
Saturday, October 22, 2011
Bukkit, restart script
The script we use to stop bukkit, tar up the world, render the overviewer map and restart bukkit again. The last part is rather silly as it involves a hacky way of getting a screen going that accepts "-X stuff". Reason is the screen has to have been connected to and detached again for it to work.