Add char field to set a password that is required to join the server

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
[james: Apply yapf formatting]
[james: Minor adjustment to help text]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
schiriki authored and James Valleroy committed 2022-06-18 10:26:51 -04:00
1 parent a7c9248200
commit 7028e3d022
3 files changed
+27

No files matched your search

+12
View File
@@ -39,6 +39,10 @@ def parse_arguments():
subparsers.add_parser('get-root-channel-name',
help='Print the root channel name')
subparser = subparsers.add_parser(
'change-join-password', help='Set the password to join the server')
subparser.add_argument('join_password', help='New join password')
subparsers.required = True
return parser.parse_args()
@@ -92,6 +96,14 @@ def subcommand_set_domain(arguments):
domain_file.write_text(arguments.domain_name)
def subcommand_change_join_password(arguments):
"""Change to password that is required to join the server"""
aug = load_augeas()
aug.set('.anon/serverpassword', arguments.join_password)
aug.save()
action_utils.service_try_restart('mumble-server')
def subcommand_change_root_channel_name(arguments):
"""Change the name of the Root channel."""
aug = load_augeas()