From 8682daad58023fd6297945d602d2044f3e8f063f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 24 Feb 2009 16:30:39 -0500 Subject: Setup automator: Prompt for password twice. Closes: #516973 --- IkiWiki/Setup/Automator.pm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'IkiWiki/Setup') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index 42caf3039..b63c8e245 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -110,11 +110,20 @@ sub import (@) { next if $admin=~/^http\?:\/\//; # openid # Prompt for password w/o echo. + my ($password, $password2); system('stty -echo 2>/dev/null'); local $|=1; print "\n\nCreating wiki admin $admin ...\n"; - print "Choose a password: "; - chomp(my $password=); + for (;;) { + print "Choose a password: "; + chomp($password=); + print "Confirm password: "; + chomp($password2=); + + last if $password2 ne $password; + + print "Password mismatch.\n\n"; + } print "\n\n\n"; system('stty sane 2>/dev/null'); -- cgit v1.2.3