MCServer Autoupdate Script (for Linux)
#1
Brick 
Salutations!

Since updating whilst trying to preserve configuration and world is so tedious, for me anyway, I wrote a little updater script.

Exclamation WARNING - Please manually backup your files first before testing this script. I cannot be blamed if it deletes your world!
Exclamation INFORMATION - This script assumes your MCServer is in a directory called 'mcserver' and that you are currently one up from that directory. You can change the directory by editing the MCSDIR variable.

This script detects your platform, downloads the correct ball of tar from Bearbin's Automated Building Server, extracts, stops MCS, copies, and starts.

To use this script, make sure you are one up from you server folder, and enter the command:
Code:
wget https://github.com/tigerw/MCServer-Autoupdate-Script/raw/master/updateserver.sh && bash updateserver.sh

To see the source code, visit the hub of gits page.

Near completely rewritten with 200% extra functionality, courtesy of the venerable and awesome Bearbin! Visit his hub of gits here.
Additional contributions stem from xoft and jimmis' recommendations. Your help was gratefully received!

Thanks for looking!
Reply
Thanks given by: bearbin
#2
Good, a MCServer server. The only problem is that I use 1.5.2 because 1.6.2 is laggy Undecided
I hate new launcher.
Reply
Thanks given by:
#3
Oooh, a public MCServer server Smile Cool!
Reply
Thanks given by:
#4
I just donwloaded 1.6.2 and now server is offline Undecided.

tigerw, please, can you set authentificate to 0? Huh
You can use STR_Warrior Login plugin.
Reply
Thanks given by:
#5
(07-12-2013, 10:00 PM)tonibm19 Wrote: I just donwloaded 1.6.2 and now server is offline Undecided.

tigerw, please, can you set authentificate to 0? Huh
You can use STR_Warrior Login plugin.

Hello! Switched off authentication. Do you not have an account for MC?
Reply
Thanks given by:
#6
Thank you.
I haven't a minecraft account but I think I'll buy it in the future because I really like Minecraft. It only could be better if it were not written in java.
About your server, now I can't join, I'm not on the computer, but, is creative or survival?
Reply
Thanks given by:
#7
I think that this could be of some help.
Reply
Thanks given by:
#8
(07-12-2013, 11:56 PM)tonibm19 Wrote: Thank you.
I haven't a minecraft account but I think I'll buy it in the future because I really like Minecraft. It only could be better if it were not written in java.
About your server, now I can't join, I'm not on the computer, but, is creative or survival?

It's survival, but if you want creative mode, give me your username and I shall promote you to a higher rank.

(07-13-2013, 01:54 AM)jimmis98 Wrote: I think that this could be of some help.

Nah, that's the vanilla server. It generates its config files, but the configuration for MCServer comes with the package. That is why it's frustrating, because with every new update, the old configs are overwritten.
Reply
Thanks given by:
#9
You don't need to extract the config files, just instruct your unzipping program to extract only the binary.
Reply
Thanks given by: tigerw
#10
(07-13-2013, 02:11 AM)tigerw Wrote:
(07-13-2013, 01:54 AM)jimmis98 Wrote: I think that this could be of some help.

Nah, that's the vanilla server. It generates its config files, but the configuration for MCServer comes with the package. That is why it's frustrating, because with every new update, the old configs are overwritten.

If you check the script, there is a part that closes the server. Here it is:
Quote:mc_stop() {
if pgrep -u $USERNAME -f $SERVICE > /dev/null
then
echo "Stopping $SERVICE"
as_user "screen -p 0 -S minecraft -X eval 'stuff \"say SERVER SHUTTING DOWN IN 10 SECONDS. Saving map...\"\015'"
as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-all\"\015'"
sleep 10
as_user "screen -p 0 -S minecraft -X eval 'stuff \"stop\"\015'"
sleep 7
else
echo "$SERVICE was not running."
fi
if pgrep -u $USERNAME -f $SERVICE > /dev/null
then
echo "Error! $SERVICE could not be stopped."
else
echo "$SERVICE is stopped."
fi
}
Reply
Thanks given by: tigerw




Users browsing this thread: 9 Guest(s)