Automated Bash Install Script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Automated Bash Install Script
# 1  
Old 01-14-2012
Automated Bash Install Script

I'm making an automated bash install script. When you install mysql-server using apt-get, there's a blue dialog screen where it wants you to chose your mysql root password.

Is there a way to pre-define the password in the apt-get command, or have it not chose a root password?

It's not a screen in the normal bash shell, so piping passwords to it doesn't seem to work.
# 2  
Old 01-14-2012
Code:
apt-get install debconf-utils

for starters.

Code:
debconf-get-selections  | grep mysql

Code:
sudo dpkg-reconfigure <mysql-package>

to "reset" the mysql install password.

"Preseed" is the technical term

Create a /root/mysql.preseed file and add:
mysql-server mysql-server/root_password password root_pass
mysql-server mysql-server/root_password_again password root_pass
mysql-server mysql-server/start_on_boot boolean true

Code:
cat /root/mysql.preseed | sudo debconf-set-selections
sudo apt-get install -y --force-yes mysql-server

That should get you there.
Here's a link on how to roll your own MySQL I asked re: this very subect at askubuntu.com

HTH.
# 3  
Old 01-16-2012
Thanks!

Hey man works great:

Code:
apt-get install debconf-utils
echo "mysql-server-5.1 mysql-server/root_password password yourpassword" > ~/mysql.preseed
echo "mysql-server-5.1 mysql-server/root_password_again password yourpassword" >> ~/mysql.preseed
echo "mysql-server-5.1 mysql-server/start_on_boot boolean true" >> ~/mysql.preseed
cat ~/mysql.preseed | sudo debconf-set-selections
apt-get install mysql-server


Thanks much!
Login or Register to Ask a Question

Previous Thread | Next Thread

3 More Discussions You Might Find Interesting

1. Solaris

Run automated bash commands from sh login shell

I use plink.exe to automate remote commands that return data to Windows machines. This works well on newer servers running Red Hat since the commands were developed for bash and the designated user's login shell is bash. I need to also support older servers which are running Solaris 10 but the... (5 Replies)
Discussion started by: randman1
5 Replies

2. Shell Programming and Scripting

Create automated scan of specific directory using bash

I am trying to use bash to automate the scan of a specific directory using clamav. Having this in place is a network requirement. The below is an attempt to: 1. count the extensions (.txt, .jpeg) in a directory and write them to a virus-scan.log (section in bold) 2. scan each folder in the... (6 Replies)
Discussion started by: cmccabe
6 Replies

3. Shell Programming and Scripting

Automated FFmpeg Convert Bash Script

I need a bash script that will. So here is what I made so far. 1. Convert video files to iPhone format 2. MV converted video to new directory (with domain.com attached to it) 4. Copy a NFO file (from another directory) and add some conversion information 5. Delete old directory torrent... (6 Replies)
Discussion started by: domz
6 Replies
Login or Register to Ask a Question