MC
MCServers - Linux MC Server Management Service Script
1.23 March 3, 2017Linux Service Script to Start, Stop, Update, and View console of MC Servers easily and Automatic!
1.23 March 3, 2017latestBuildtools fixMar 3, 2017 I had an odd issue where buildtools was failing. After deleting the Buildtools directory, the script wouldn't download and run buildtools because it's directory was missing. Added a check for the directory before it CDs, Change Directory. If the directory exists, it moves on. If it doesn't, it creates the directory, moves into said directory, then continues. I noticed when I went to update the version/date at the end of the script, it said Jan 2016 for the last few updates, should have been Jan 2017. Not sure how I managed to goof that up.1.20 Jan 5, 2016Enough of them pesky pauses!Jan 5, 2017 Other than some code cleanup and fixes, I've added an option to disable the unneeded pauses where unneeded. You will need to update your servers.cfg to add in a line for the new option. Otherwise the menu actions that have the unneeded pauses will zip right on by. So if you enjoy the pauses, such as in "service mcservers server status" and you have multiple servers listed there, you may or may not want the pauses. Add to servers.cfg: UNNEEDED_MENU_PAUSING="True" True allows the pauses, anything else, or blank, will disable the pauses. Please keep in mind, some areas of code keeps pauses because of each pause is a step in a loop server check, timed countdown, or waiting for an action outside of the user's input. If I have overlooked a spot you think a pause is or is-not needed, let me know.1.19 Jan 3, 2016Why stop with a few updates?Jan 4, 2017 Got into one of them moods to just keep going. So I added in another feature I had been sketching up before. · Got a server you want to be able to start, but not automatically on computer/system startups? Change the SERVER_ENABLED from false/true to "manual" · Example: SERVER_ENABLED[$BUNGEE]=manual · Command: service mcservers server start 3 OVERRIDE · This will force the server to start, as long as it's not set to anything but "true" or "manual". OVERRIDE must be capitalized. · Fixed/corrected how template files are created. I had been using single quotes instead of normal quotes. Then used escape codes where needed to keep normal quotes and $VARIABLES in the output of the template file. · You won't see much in the way of changes, but on my end, less caution/suggested changes in the debugger. · Altered the output servers.cfg file to have a dedicated example server listing, and two real server listings, a disabled Bungee listing and an enabled Spigot Survival server. · Fixed an odd typo that had been around for a while. Only effected the output of where the servers.cfg was created. Two typos in one variable word.1.18 Jan 3, 2016[ReUpload] Long Awaited... Yeah, got no unique name...Jan 4, 2017 It's been a while since I've updated the plugin. Minor side note: This if a fix of the most recent update I just uploaded. Had a code breaking typo in the Update All command. Wasn't carrying over the "y" portion of the command. There was an odd error during server startups about creating the server. However, this appeared to be an experience of my own. Not only because no one else reported it, but when I cleared out my servers.cfg file to make a fresh start on running my servers and rebuild my MCDen community, the error vanished. I have no clue how or what was causing it. If you have this issue, please let me know. Those of you who has automated backups and cleaning jobs, please follow the change log below. Commands have changed to be more specific. Major Changes: · Fixed a few commands that asked Y/N questions, but were not taking a Y/N at the end of the command. Mainly these commands didn't have this code. I've implemented this in both Backing Up Servers and Cleaning out server backups. (Update to mention this includes the update command as well!) · Expanded on info given on backing up and cleaning up backups. Now saves the backups of each server to their own directory, and allows cleaning out backups of specified server's backups. · Examples: Server ID# 0 is Survival. · Backup: "service mcservers backup 0 y" will automatically skip the question and backup the server Survival to backup directory of choice, followed by server name's folder, then it's backup. Such as /home/minecraft/MCServersBackups/Survival/Survival-Date-Time.zip · Cleanup: "service mcservers backup clean 0 5 y" will automatically skip the question and begin cleanup of Survival's backups exceeding 5 days old. · All backup and cleanup commands give a before and after size usage. This includes the specified server's backup directory and the total size of all backups together. Minor Changes: · Added version and last update at the end of the main help menu. · Updated some of the template output info for creating the servers.cfg file to reflect this current MC/Spigot version, which is 1.11.2. Originally stated 1.9. A tad behind don't you agree? · Colored some important info, such as user inputed, or related user input, to help clear up possible mix-ups or confusion. So if the user states the Server ID# 0, the output text will be light green with the related variable dark green or yellow. Reupload to fix a1.17Send commands to server screen and updated help menuApr 6, 2016 Added: · By minor request, I've added in a function to allow sending commands to selected screens. "mcservers screen 1 send tell console message to console from console" · Updated the main help menu to include details on the recently added Y variable for Backups and Cleaning. Added details for easily killing a screen. (Just thought about adding a variable "restart" at the end to attempt starting the server after killing the server...) · Added help details to commands Screen, and related Send. Cleaned up some code related to the Screen command.1.16-1Forgotten to implement Y Variable to Clean...Apr 3, 2016 As I was updating the plugin display, I forgot to add the Y variable for skipping the question to the clean command. Refer to last update for details; similar to the skipping of question in Backups.1.16New commands updated. Announcements of backups.Apr 3, 2016 Fixed: · Using the backup command in general was broken. It was working during tests before the last update. It's fixed and tested before upload this time. List, Clean, and ServerID# variables work now. Added: · Announcements of when the server is backing up and finished if server is online. · Server commands to Save-All followed by Save-Off is ran before backup, then Save-On ran after backup. · For those of you who want to run automated backups (aka cron jobs), it can now be easily ran without the question waiting for input. Add Y to the end of the command. Ex: "sudo service mcservers backup 2 y" will immediately backup the server, even if it's online or offline. If requested, I'll add the announcement variables to the servers config for easier changing, such as in another language. For now, the announcements are "Saving Disabled. Backing Up!" and "Saving Enabled. Backup Complete!" The announcements and commands before/after backups will put a little bit of spam in the console, as the commands are ran as if someone typed the commands to the respective console directly. Take caution on frequency of backups if you don't want too much spam. Note to anyone who wants to automate backing up multiple servers and a cleanup in one command: Code (Text): service mcservers backup clean 5 && service backup 0 y && service mcservers backup 1 y This will run the cleanup, once it's done, backup of server ID 0, once it's done, backup of server ID 1.1.15Fixes and AdditionsMar 31, 2016 I've pushed this update a tad bit sooner than expected, for Spigot --rev fix. Improved the Backup area of the script: Now able to direct exactly where you want to have the backups saved. Useful if you use a separate program for backups, such as Dropbox. (Yes it's on linux and with commandline only, with no UI. If there is demand, I'll put up a quick guide on setting it up.) Note: · Changing the backup directory does not move currently made backups. You will need to do this yourself. · Currently there is no check and create method for directories set. If you direct to folder that does not exist, it will error. This will be fixed soon. · If you don't want to re-create the config, add the following line: · MANUAL_BACKUPS_LOCATION="none" #Choice of where backups are saved. Default: none = Disables Backup until directory is set. · Example: MANUAL_BACKUPS_LOCATION="/home/LigerXT5/Dropbox/MCDenServerBackups" Added List command to list all backups in the set backup directory. Useful if you need to see how many backups there are, and if you need to clean out backups. Also states size of folder at top of list. Fixed the BUILDTOOLS_BUILD_VERSION: I goofed in the code and left the variable out of the command ran for building. Everyone has been forced to build 1.9 if they were wanting 1.8 or such. I do apologize, and has been fixed and tested.1.14 ALPHAConfig creation fix (temp)Mar 12, 2016 I've made a number of minor tweaks to the script in the last few months, which have gone undocumented. This Is ALPHA release. It works just fine on my system, however I can't guarantee it will work without issues elsewhere. Reason I say this is, the script was designed in Debian, and works. However in Ubuntu, which is what I'm using now, it has the config creation issue. The only major changes are: Temp Fix: Config file not being created. Unsure as to why that section of the script is not executing, so I moved the config creation up to the config check area until I find what's wrong. Added: Variable in config to state which version of Spigot to build. If nothing is stated, it uses Latest.1.1311-15-15 Fixes and additionsNov 15, 2015 If Updating: Added SHUTDOWN_MAX_WAIT for each server group. MUST be added to each server group or Stop command will fail to work. Fixes: · Fixed/added server shutdown screen checker to check if server screen has closed. If so, the screen-check countdown discontinues and proceeds to the next step. Does NOT kill the server unless the server admin tells the script to kill the screen. · Fixed color code output on the mcservers server help menu. · Fixed an addition of user directory variable for buildtools. Added: · Added variable for servers. If some servers take longer to shutdown than others, the server admin can increase the screen check max wait time in servers.cfg. Refer to first Fixed listing for details. Variable added per server is: SHUTDOWN_MAX_WAIT[$ServerGroupName]=30 #Waits maximum of 30 seconds. · Kill screen command. service mcservers screen ID# kill. Will kill the screen of ID# choice. If screen exists, it will kill it, otherwise will state server screen is offline. · Implemented comments at top of mcservers script to allow admins to customize color output of script in console. If no color is wanted, replace each color code with the code from NOCOLOR.1.12Fixes and additionsNov 11, 2015 · Added two new variables into main script. User_Directory and Minecraft_Directory. Both did the same thing as Server_Settings, however had to be split for use of GIT in Buildtools. This way users could choose a user for GIT. Still needs to be the directory under the user for the Minecraft servers. · Missing quotation marks in select areas causing an occasional issue with variables. · Replaced a large ifelse set of code with case. · Fixed issue where user input of ServerID could exceed the actual number of existing IDs. · Fixed the ALL variable in Start, Stop, and Restart. Mixed up my If statements. Also cleaned up the code for these as well. · Created a Github for the code. https://github.com/LigerXT5/MCServers1.1111-7-15 Midnight Bug fixes and additionsNov 7, 2015 Script: · I recently found out the current setup of the script, your, and my, linux server cannot start/stop the script normally upon system startup/shutdown. I have added the necessary code to allow this, though I'm not really fond of the additions, but it does the job. Once my submission is approved, I'll upload the updated version. · Fixed a bug with server directory being created, but server still not starting. · Implemented error messages. Currently for no file/directory found, along with current directory is sitting in while attempting to find file/directory. · Fixed line formatting for startups. · Disabled the "Server Directory Missing" upon linux system startup. It's only needed when the user invokes the start command. · Added Servers as an alternative to Server. Either will work. I kept typing Servers instead of Server, I figured others would be doing the exact same thing. · Added View as an alternative to Edit. Either will work. Since some times you will be viewing and not editing, you might type view by mistake instead of edit. Both do the same thing. · Added eula.txt to the edit/view listing of files that can be edited from mcservers. · Grammar and spell checking. Late night coding resulted in wrong word use. · Added ability to create template files for server.properties, spigot.yml, bukkit.yml, and commands.yml. All editable through Edit. Then copied to choice servers with Override/Import. · These templates are filled with all known settings, with mostly vanilla settings. Some settings are tweaked/changed in my personal view. If it comes down to it, I will change them out for none-personal choice of settings. · There is currently no template for help.yml, as I have no idea what a good template for help.yml would be. · Known Bug Found: If you have Two servers, one server that is only part of another, such as Survival and TestSurvival, Survival will not start/stop properly as the script sees two Survival servers. Workaround: Keep all server names unique. Such as PluginSurvival, VanilliaSurvival, or TestSurvival. 1.11 update · Fixed Template creation, editing, and overwriting. · Improved error reporting.1.1Nov 7, 2015
Similar projects
Script →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta