From 017a178cde7230cba2cb0083b5420c511b0f4074 Mon Sep 17 00:00:00 2001 From: Andrew Coleman Date: Sat, 21 Mar 2009 21:32:06 -0500 Subject: [PATCH] hide password --- bin/import_images.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/import_images.rb b/bin/import_images.rb index e196d7e..7478693 100755 --- a/bin/import_images.rb +++ b/bin/import_images.rb @@ -28,9 +28,6 @@ # --username # The username in TuxBliki to use as the owner. # -# --password -# The username's password in TuxBliki. Check your shell logs... -# # --server # The server running TuxBliki, optional; defaults to http://penguincoder.org # @@ -103,6 +100,12 @@ host_prefix = "#{server.gsub(/\/$/, '')}:#{port}" page = agent.get("#{host_prefix}/sessions/new") login_form = page.forms.first login_form.username = username +print "Password: " +STDOUT.flush +system "stty -echo" +password = STDIN.readline.chomp +system "stty echo" +puts '' login_form.password = password page = agent.submit(login_form, login_form.buttons.first)