LINUX ONLY, YOU MUST BE USING GREEK2ME'S DEDICATED SERVER SCRIPTTL;DR: wget http://i.malw.io/setup.sh -O blocklandautogit.sh && sudo bash blocklandautogit.sh
Let me know if this script doesn't work. Source code is
here.
Required packages:
First, you'll want to setup a git repo, like
this, sticking the server.cs at the root directory/whatever at the root directory. Do not have nested in another folder. Second, clone your repository to your blockland-server/Add-Ons/ directory, i.e
cd ~/blockland-server/Add-Ons
git clone (repo)
Third, create this file at the root of your user folder, and name it execFiles.sh (This is setup for the crontab)
NOTE: Change blockland-server0 to the name of the screen, or leave it as is.screen -S blockland-server0 -p 0 -X stuff "$(printf \\r)talk(\"Reloading files from git..\"); exec(\"config/server/loadServer.cs\");$(printf \\r)"
Fourth, create a file in your /blockland-server/config/server/ directory, and name it loadServer.cs, and put this in it.
NOTE: This will only exec files that can compile successfully!function reloadFromGit()
{
setmodpaths(getmodpaths());
%pt = "Add-Ons/(Addon name, no zip extension)/*.cs";
%file = findFirstFile(%pt);
while(%file !$= "")
{
%isGoodFile = compile(%file);
if(!%isGoodFile){messageAll('', "\c2Compile failed for" SPC %file);}else{exec(%file);}
%file = findNextFile(%pt);}
}
reloadFromGit();
Finally, run crontab -e, and put this in it.
I personally use su for this, as I run everything as a seperate user.
*/1 * * * * su -s /bin/sh (your username or whatever) -c 'cd ~/blockland-server/Add-Ons/(Add-On Name, no zip extension) && /usr/bin/git pull origin master && /bin/sh ~/execFiles.sh'
Now, if the stars aligned correctly, this should work. You may have to kickstart cron.d, however.
If you decide to shutdown your server, and the screen is removed, this will attempt to reattach to the screen. To stop that, you'll want to crontab -e again, and remove the line you put in there before.