From 49337ceeed70afd7c50329a14ce50c9f3cc6c51b Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Tue, 28 Jun 2016 23:54:44 +0200 Subject: [PATCH] Add possibility to enter password with a prompt --- check_syncrepl_extended | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/check_syncrepl_extended b/check_syncrepl_extended index 2909e57..5f65785 100755 --- a/check_syncrepl_extended +++ b/check_syncrepl_extended @@ -39,6 +39,7 @@ import ldap import ldap.modlist as modlist import logging import sys +import getpass from optparse import OptionParser @@ -68,7 +69,7 @@ parser.add_option( "-P", "--pwd", dest="pwd", action="store", type='string', - help="LDAP bind password") + help="LDAP bind password. Specify '-P -' to ask for a prompt.") parser.add_option( "-b", "--basedn", dest="basedn", @@ -153,6 +154,9 @@ if options.touch and not options.attrs: logging.info('Force option attrs on touch mode') options.attrs=True +if options.pwd == '-': + options.pwd=getpass.getpass() + excl_attrs=[] if options.excl_attrs: for ex in options.excl_attrs.split(','):