From f2b8a877a93b81b3d67352f11fbdb1a80460d143 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Sat, 20 Feb 2010 13:48:15 +0100 Subject: [PATCH] implement asking for the Ice secret to Murmur CLI --- pyweb/mucli.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pyweb/mucli.py b/pyweb/mucli.py index 7bc58a7..615b954 100755 --- a/pyweb/mucli.py +++ b/pyweb/mucli.py @@ -20,6 +20,7 @@ DEFAULT_SLICEFILE = '/usr/share/slice/Murmur.ice' import os, sys import inspect +import getpass from optparse import OptionParser from mumble.mctl import MumbleCtlBase @@ -48,6 +49,16 @@ parser.add_option( "-c", "--connstring", default=None ) +parser.add_option( "-i", "--icesecret", + help="Ice secret to use in the connection. Also see --asksecret.", + default=None + ) + +parser.add_option( "-a", "--asksecret", + help="Ask for the Ice secret on the shell instead of taking it from the command line.", + action="store_true", default=False + ) + parser.add_option( "-s", "--slice", help="path to the slice file. Default is '%s'." % DEFAULT_SLICEFILE, default=None @@ -109,8 +120,10 @@ if options.verbose: print >> sys.stderr, " Slice: %s" % options.slice print >> sys.stderr, "Encoding: %s" % options.encoding +if options.asksecret or options.icesecret == '': + options.icesecret = getpass.getpass( "Ice secret: " ) -ctl = MumbleCtlBase.newInstance( connstring=options.connstring, slicefile=options.slice ) +ctl = MumbleCtlBase.newInstance( options.connstring, options.slice, options.icesecret ) if not progargs: