Command line updating?

How would I update a server to the latest version via the command line? For some reason I cannot forward 8080, so I am stuck using just normal ssh. I’ve come across mineos_console.py, but for some reason it doesnt have the same commands as in 0.5.x. For example,

 ./mineos_console.py -s servername set profile profilename

doesn’t work, but returns

{set profile profilename} sent to gameserver console [screen_pid:xxxx] successfully. 

This happens with other commands as well, such as restart, get, etc.

Is there a simpler way and/or am I doing this wrong?

Thanks

Others will have other answers. I used a combination of these two guides. Use the one that works best for your type of install.

Official Guides:
Official Updating the Web UI
Official MineOS Page

My saved notes with credits:
Here is how I took my MineOS Turnkey 64 install and upgraded it to all the latest software:

PHASE 1 - Upgrading the OS

1. Download “mineos_turnkey-x64.iso” from http://minecraft.codeemo.com/crux/

2. Burn to disk or mount ISO if doing VM install.

3. Install with this CD / ISO

4. Choose yes to install security updates after creating passwords

5. After install is completed, open terminal connection.

6. su -

7. lsb_release -a shows:

root@core ~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 7.0 (wheezy)
Release: 7.0
Codename: wheezy

8. cd /etc/apt/sources.list.d

9. nano sources.list

10. comment out this line: 

deb http://http.us.debian.org/debian sid main

11. uncomment out this line: 

deb http://cdn.debian.net/debian wheezy non-free

12. CTRL+X and save

13. apt-get update

14. apt-get dist-upgrade

15. choose default answer to any questions (i.e. keep modified grub config file)

16. lsb_release -a shows:

root@core apt/sources.list.d# lsb_release -a
No LSB modules are available.|
Distributor ID: Debian
Description: Debian GNU/Linux 7.1 (wheezy)
Release: 7.1
Codename: wheezy

17. reboot

(not really necessary but just proving to yourself that all is OK when it reboots successfully and you see it say: “Welcome to Core, TurnKey Linux 13.0rc / Debian 7.1 Wheezy” when you log back into the terminal)

PHASE 2 - Upgrading Webmin from 1.610 to 1.630

1. open terminal to server

2. su -

3. apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python

4. wget http://prdownloads.sourceforge.net/webadmin/webmin_1.630_all.deb

5. dpkg --install webmin_1.630_all.deb

6. open web browser to https://xxx.xxx.xxx.xxx:12321

7. log in with root credentials

8. On top menu bar click the “Webmin” on the top left.

9. On this page, click the “Update Detected Operating System”

10. Click the “Install Updates Now” on this same page.  Now webmin (should you enjoy using that tool - it has MySQL management built in) is completely up to date.

PHASE 3 - Opening additional ports in firewall (because I like to have more than one Minecraft server running)

1. open terminal to server

2. su -

3. cd /etc

4. nano iptables.up.rules

5. add these lines at end:

-A INPUT -p tcp -m tcp --dport 25565 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 25566 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 25567 -j ACCEPT

6. CTRL+X and save

7. reboot

PHASE 4 - Updating MineOS scripts and creating a server

1. open a web browser to http://xxx.xxx.xxx.xxx:80/admin

2. log in with “web-ui” credentials created during original install

3. Click “update” button in the “vanilla” profile line on the overview page.

4. Click the “check for newer versions” under the script versions.

5. Go to the “create new server” tab

6. Supply server name

7. update memory allocated

8. choose gameplay options

9. click “create server”

10. click the “server status” tab

11. click “start” next to that server

I’m not a Linux genius so while everything seems to be working for me, there could be mistakes or things I could have done better or more efficiently. I welcome any and all feedback!

  • SBHouse

1 Like

I can’t post more than two hyperlinks within an response so please remove as you read the above post.

OK, it looks like I have gained permissions so I’ve cleaned up the above post making this one moot.

William…

mineos_console.py changed in 0.6.x to get rid of a lot of magic numbers that required users to either have to know specifically a command like get or set in addition to the property they wanted to change… By “magic number” (see above link), I mean that people would have to know specific commands and syntax to know how to operate it from the CLI.

The changes in 0.6.x helped to alleviate that by being more consistent in commands. For example,

# ./mineos_console.py -s myserver up
False
# ./mineos_console.py -s myserver profile
'vanilla179'
# ./mineos_console.py stock_profile vanilla1710
# ./mineos_console.py update_profile vanilla1710
# ./mineos_console.py update_profile vanilla1710
Discarding download; new md5 == existing md5
# ./mineos_console.py -s myserver profile vanilla1710
previous value:
'vanilla179'
current value:
'vanilla1710'

Now, instead of having to get or set, simply knowing the name of the property or function is enough to induce it. In this example myserver is currently down and is assigned the profile ‘vanilla179’. I am able to introduce a stock profile for use through the next command (which you can see does not reference the server with “-s”), update it and then change over the profile.

If you’re wondering what the available options are for mineos_console.py, it is the entirety of the def functions in mineos.py.

So to finish off:

# ./mineos_console.py -s myserver accept_eula
{accept_eula} completed successfully.
# ./mineos_console.py -s myserver start
{start} completed successfully.
# ./mineos_console.py -s myserver ping
ping(protocol_version=u'127', server_version=u'1.7.10', motd=u'A Minecraft Server', players_online=u'0', max_players=u'20')

I must emphasize, however, that as much as you can accomplish via CLI, the web-ui is unquestionably going to be easier. Profiles are immutable by design, and thus beyond the one time you need to update a profile, you’ll likely never need to do it again. That said, it is in your best interest to address the true problem-at-hand of forwarding port 8080 (or letting it through the firewall, etc.).

One last thing: you say you cannot forward 8080–this is not necessary if you’re connecting from a computer on the same local network; have you made sure to attempt to connect via https rather than http?

Thanks for the info Hexparrot. I was unaware of those cli script options. I must say the GUI is very nice.

William…

Yes, that is exactly what I was looking for hexparrot. Thank you! I am not on the local network (server is at home, I am at college). I know it isn’t secure or whatever, but no one has the IP except me and my close friends.

Thanks for your response!

Webmin is up to 1.7 and Debian is up to 7.2. Any changes need to be made to accommodate? Following these directions one thing I have to do is leave original source (Phase 1, step 10) uncommented to get apt-show-versions. I also have yet to see Update Detected on Phase 2, step 9.