Results 1 to 3 of 3
Hey.
I've wrote a bash script that completely automates the installation and configuration of a webhosting server.
However, when it gets to installing MySQL, it asks to input a password.
...
- 12-11-2009 #1Just Joined!
- Join Date
- Dec 2009
- Posts
- 2
Bash Automation Problem
Hey.
I've wrote a bash script that completely automates the installation and configuration of a webhosting server.
However, when it gets to installing MySQL, it asks to input a password.
My question is this.
Is there a way I can automatically fill in the box?
I have the password required in a variable called 'sqlpass', but cannot find a way of inputting it into the box.
It's one of the blue boxes that comes up when dpkg runs.
"apt-get install mysql-server-5.0"
I'm doing this on Debian Lenny btw.
It's been driving me nuts, so any help would be very greatly appreciated.
Thanks in advance,
Lee.
- 12-12-2009 #2Just Joined!
- Join Date
- Aug 2005
- Posts
- 65
i donno if that will work
can't u save the password to a file then make dpkg read its input from the file then remove the file , something like
Code:echo $password > passwordFile dpkg -i mysql < passwordFile rm passwordFile
- 12-12-2009 #3Just Joined!
- Join Date
- Dec 2009
- Posts
- 2
Not too sure that'll work.
All the packages are downloaded/installed by apt, and it asks you to confirm the password twice.
So I'm pretty stuck. It's the only thing in the whole script that seems to be causing a problem.
Any ideas?
Just to give some context..
That's where its being used. You can see mysql-server-5.0 is being installed, and below that the root password should be set, but the blue input box appears before that stepCode:apt-get install -y mysql-server-5.0 mysql-client libmysqlclient15-dev sed -i -e 's/bind-address/#bind-address/g' /etc/mysql/my.cnf mysqladmin -u root password "$sqlpass" /etc/init.d/mysql restart


Reply With Quote
