mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-29 10:10:19 +00:00
minetest: Create the configuration directory if necessary for Trixie
Closes: #2514 - On Trixie the configuration directory is /etc/luanti and not /etc/minetest. So, it needs to be created. Tests: - On Trixie and Bookworm, updating configuration works. On Trixie, directory is created if it does not exist. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
daa7c326b8
commit
8c6c31d991
@ -1,6 +1,8 @@
|
|||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
"""Configure Minetest server."""
|
"""Configure Minetest server."""
|
||||||
|
|
||||||
|
import pathlib
|
||||||
|
|
||||||
import augeas
|
import augeas
|
||||||
|
|
||||||
from plinth import action_utils
|
from plinth import action_utils
|
||||||
@ -15,6 +17,7 @@ def configure(max_players: int | None = None, enable_pvp: bool | None = None,
|
|||||||
creative_mode: bool | None = None,
|
creative_mode: bool | None = None,
|
||||||
enable_damage: bool | None = None):
|
enable_damage: bool | None = None):
|
||||||
"""Update configuration file and restart daemon if necessary."""
|
"""Update configuration file and restart daemon if necessary."""
|
||||||
|
pathlib.Path(CONFIG_FILE).parent.mkdir(exist_ok=True)
|
||||||
aug = load_augeas()
|
aug = load_augeas()
|
||||||
if max_players is not None:
|
if max_players is not None:
|
||||||
aug.set(AUG_PATH + '/max_users', str(max_players))
|
aug.set(AUG_PATH + '/max_users', str(max_players))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user