summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-09-18 19:52:52 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-09-18 19:52:52 +0000
commit60c1df3778d6efe934ec13a4ade20d55b6a5f202 (patch)
tree6d901ff0fbd4e93f887050cbae51fb5b4e25d275
parent569c78fffe7f79ac368a268349bb9685b16ab4dd (diff)
Don't ask for password if passed as argument
git-svn-id: https://svn.roundcube.net/trunk@1833 208e9e7b-5314-0410-a742-e7e81cd9613c
-rwxr-xr-xroundcubemail/bin/msgimport.sh15
1 files changed, 9 insertions, 6 deletions
diff --git a/roundcubemail/bin/msgimport.sh b/roundcubemail/bin/msgimport.sh
index a3ae4c3f2..9bd97c61c 100755
--- a/roundcubemail/bin/msgimport.sh
+++ b/roundcubemail/bin/msgimport.sh
@@ -77,11 +77,14 @@ if (empty($args['user']))
}
// prompt for password
-echo "Password: ";
-$args['pass'] = trim(fgets(STDIN));
+if (empty($args['pass']))
+{
+ echo "Password: ";
+ $args['pass'] = trim(fgets(STDIN));
-// clear password input
-echo chr(8)."\rPassword: ".str_repeat("*", strlen($args['pass']))."\n";
+ // clear password input
+ echo chr(8)."\rPassword: ".str_repeat("*", strlen($args['pass']))."\n";
+}
// parse $host URL
$a_host = parse_url($args['host']);
@@ -119,7 +122,7 @@ if ($IMAP->connect($host, $args['user'], $args['pass'], $imap_port, $imap_ssl))
if ($IMAP->save_message($args['mbox'], rtrim($message)))
$count++;
else
- die("Failed to save message to $mailbox\n");
+ die("Failed to save message to {$args['mbox']}\n");
$message = '';
}
continue;
@@ -134,7 +137,7 @@ if ($IMAP->connect($host, $args['user'], $args['pass'], $imap_port, $imap_ssl))
// upload message from file
if ($count)
- print "$count messages successfully added to $mailbox.\n";
+ print "$count messages successfully added to {$args['mbox']}.\n";
else
print "Adding messages failed!\n";
}