[shell] Minetest Server Control (mtctl) [commandline]

Post Reply
User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

[shell] Minetest Server Control (mtctl) [commandline]

by Miniontoby » Post

mtctl: A minetest server control command

Based on: systemctl (linux) and rcctl (openbsd)

Current Version 1.6


Usage:

The mtctl is using the following pattern:

$ mtctl <action> [worldname]
  • action: start|stop|restart|status|create|backup|enable|disable|list|help
  • worldname: worldname to control

Features:

This command has some extra features:
  • Per-user config, so you can run per user your own server
  • Live backup thanks to Minix: You can make backups whilst the server is running (without restart)
  • Also usable with a panel
  • Start any server at boot using the enable command! (makes use of crontab to start at reboot)

Install:

This script is easy to install, thanks to a one-line-installer.

This installer will detect your OS and based on that info it will select which shell you have (and some other things)


The command itself is the following:

$ curl -sSL https://ircforever.org/mtctl.php | $SHELL


Update:

To update the mtctl, just do $ mtctl check_updates, that will check updates and install them when there is a update


Setup worlds:

For existing worlds:

Put your minetest.conf in your worlds/<yourworldname> as world.conf
Also specify the port in the world.conf

For new worlds:

Use $ mtctl create <worldname>
Or use the instruction for the existing worlds


Source:

The source is avaible at https://cvsweb.planetofnix.com/cgi-bin/cvsweb/mtctl

And here you can find the change log



Copyright (C) 2021-2023 by Miniontoby <miniontoby@ircnow.org>

Permission is granted to use, copy, modify, and/or distribute this work for any purpose with or without fee. This work is offered as-is, with absolutely no warranty whatsoever. The author is not responsible for any damages that result from using this work.
Last edited by Miniontoby on Thu May 18, 2023 18:28, edited 12 times in total.
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [shell] Minetest Server Control (mtctl) [commandline]

by Miniontoby » Post

Version 1.0

The first release version is now officialy out!!!

Check the main topic to see the info about the whole command
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [shell] Minetest Server Control (mtctl) [commandline]

by Miniontoby » Post

Version 1.2

Version 1.2 is out!

It now has the 'mtctl backup <world>' thanks to Minix (check the Features part in the main post for more info)

Btw Version 1.1 was already out, but it had gone a bit wacky, so thats why it doesn't exist

check changelog.txt for the things that have changed
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [shell] Minetest Server Control (mtctl) [commandline]

by Miniontoby » Post

Version 1.3

Version 1.3 is out!

- Fixed installer using root whilst executed as root
- Fixed License
- Updated status command to look like the one at linux
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

c56
Member
Posts: 307
Joined: Wed Apr 21, 2021 03:05
GitHub: tigercoding56
In-game: bm5 or bemo5 also sell_her_on55

Re: [shell] Minetest Server Control (mtctl) [commandline]

by c56 » Post

could you add an action to send / execute chat commands ?
this is a signature not a place to post messages also if i could change my username i would change it to sell_her_on55

c56
Member
Posts: 307
Joined: Wed Apr 21, 2021 03:05
GitHub: tigercoding56
In-game: bm5 or bemo5 also sell_her_on55

Re: [shell] Minetest Server Control (mtctl) [commandline]

by c56 » Post

also does a started world persist across a hardware (sudo reboot ) reboot ?
this is a signature not a place to post messages also if i could change my username i would change it to sell_her_on55

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [shell] Minetest Server Control (mtctl) [commandline]

by Miniontoby » Post

c56 wrote:
Sun Jul 24, 2022 18:21
could you add an action to send / execute chat commands ?
You will need an external mod to do that since this doesn't use a dbus like way using the --terminal argument that exists without my knowledge, but I still got the mod for it so it would be possible!



Update: I have found the way to do it. It will be using mkfifo and it should be cross platform available.
Last edited by Miniontoby on Wed Jul 05, 2023 12:53, edited 2 times in total.
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [shell] Minetest Server Control (mtctl) [commandline]

by Miniontoby » Post

c56 wrote:
Sun Jul 24, 2022 18:22
also does a started world persist across a hardware (sudo reboot ) reboot ?
Not yet, but I am working on it

UPDATE: This has been added, see viewtopic.php?p=424548#p424548
Last edited by Miniontoby on Tue May 02, 2023 18:08, edited 1 time in total.
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [shell] Minetest Server Control (mtctl) [commandline]

by Miniontoby » Post

c56 wrote:
Sun Jul 24, 2022 18:22
also does a started world persist across a hardware (sudo reboot ) reboot ?
With the new update that should be synced within 15 minutes from now (20:05 CEST) on, this is added and (should) work!

So with that said:


Version 1.6

Version 1.6 is out!

- Auto start servers: Enable or Disable your servers to start at boot

(P.s. I just see I forgot to add the other version changelogs... you can actually see them here)


UPDATE:

Hotfix 1.6.1 is out!

- Fixed stuff for the enable and disable
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
Nininik
Member
Posts: 496
Joined: Thu Apr 06, 2023 01:55
GitHub: nininik0
IRC: nininik
In-game: nininik
Location: CA, Team thunderstrike headquarters
Contact:

Re: [shell] Minetest Server Control (mtctl) [commandline]

by Nininik » Post

so this hosts server without that pain?
↯Glory to Team Thunderstrike!↯
↯T.T.S.↯

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests