Tigerw's Autoupdate Script is a bit outdated but has the right idea, and you could probably build on it.
https://github.com/tigerw/Cuberite-Autoupdate-Script
About your second question: It should be possible to attach your sender to the stdin of the server process and send a message into it. Named pipes, maybe? Or use screen, that's quite easy.
https://github.com/tigerw/Cuberite-Autoupdate-Script
About your second question: It should be possible to attach your sender to the stdin of the server process and send a message into it. Named pipes, maybe? Or use screen, that's quite easy.