Register
It is currently Thu Apr 17, 2014 12:25 pm

Passphrase entrance


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Tue Jan 26, 2010 5:22 pm   

Joined: Tue Jan 26, 2010 5:07 pm
Posts: 1
Hi all,
I'm pretty new at scripting and and just have done some simple scripts - so my hope is that someone of you is able to help me.

We have a program running, which does include database, but also a "Zone" and kind of a Certificate. The Backup of the database is not a problem, but the Certificate and the Zone. When I backup those, it asks for a passphrase to enter. It works manually, but I would like to do that with a script.
When I enter the backup command, it takes sometimes 3, sometimes 5 seconds until it asks for the passphrase.
Is there any way to give the passphrase in the script?
Any help and suggestions appreciated,
Tom


Top
 Profile  
 PostPosted: Tue Jan 26, 2010 7:21 pm   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 511
Hi tunix,

yah,

' would use expect which is not a bash matter.


Top
 Profile  
 PostPosted: Thu Jan 28, 2010 2:22 am   

Joined: Mon Nov 17, 2008 7:25 am
Posts: 221
You can always try to pass it via STDIN, but most programs does not allow this.

For example, the STDIN directional syntax is the "<<<" part.
Code:
mysql -uroot -p database <<< "SELECT * FROM tblname;"


MySQL takes from STDIN and passes it as a command on the prompt. I've seen applications which can do this with password requests also.
For example, if $password is set to "123qwe":
Code:
yourapplication-binary <<< "$password"


If this doesn't work then I'd recommend to use Expect, but that is not a bash issue.

Best regards
Fredrik Eriksson


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP