Ahtenus/minecraft-init — pull request #71 by jbondhus (2012-04-30 16:51:26+00:00)
Title: Backup-Restore Function

I have wrote a new function for restoring backups, which allows the user to simply drag the .zip or .tar.gz files into a designated folder remove the date and time (making it like world.zip or world.tar.gz), then run the script by going "/etc/init.d/minecraft restore".This will ask you a couple of questions before you begin, such as amount of worlds you want to restore and each time it restores one it will ask you the name of the world. It will remind you to make sure that the worlds don't have the date appended, and then automatically unzip or un-tar them and copy the world folders into the specified output directory. This means that you can process as many worlds as you want, quickly and painlessly, simply by putting the input and output directories in the config file. If you tell it that you have 2 worlds you want to restore, it will do them 1 by one, asking you for the name each time (so that it knows which world to copy). Like I said, I don't know bash script very well, so if there's anything that can be improved to make it easier or more efficient, please let me know. I have tested it on my server, but that doesn't say anything about other people's setups, so there is a chance that there is still bugs. If you have any questions please ask me, but I recommend that we merge it into the master branch so that we can find out if there are any bugs. If there are, they won't impact the rest of the script because according to my computer all the syntax checks out OK.