diff options
author | Oliver Tappe | 2007-09-23 17:28:07 +0200 |
---|---|---|
committer | Oliver Tappe | 2007-09-23 17:28:07 +0200 |
commit | 9d53f9972028b77038053da28e90deed223d5908 (patch) | |
tree | 13a25efd6059068570ec0ac639dd9204925c0850 /lib/OpenSLX/Utils.pm | |
parent | New splashy binaries. Splashy versoin 0.3.5, compiled with Glibc 2.3. (diff) | |
download | core-9d53f9972028b77038053da28e90deed223d5908.tar.gz core-9d53f9972028b77038053da28e90deed223d5908.tar.xz core-9d53f9972028b77038053da28e90deed223d5908.zip |
* added readPassword() to Utils.pm, a function which fetches a password
from the terminal (via readline).
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1342 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'lib/OpenSLX/Utils.pm')
-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; |