diff options
-rw-r--r-- | lib/OpenSLX/Utils.pm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/OpenSLX/Utils.pm b/lib/OpenSLX/Utils.pm index 86c31ca9..57ca8040 100644 --- a/lib/OpenSLX/Utils.pm +++ b/lib/OpenSLX/Utils.pm @@ -32,6 +32,7 @@ $VERSION = 1.01; chrootInto mergeHash getFQDN + readPassword ); ################################################################################ @@ -276,4 +277,16 @@ sub getFQDN return $FQDN; } +sub readPassword +{ + my $prompt = shift; + + use Term::ReadLine; + my $term = Term::ReadLine->new('slx'); + my $attribs = $term->Attribs; + $attribs->{redisplay_function} = $attribs->{shadow_redisplay}; + return $term->readline($prompt); + +} + 1; |