Last active
August 29, 2015 14:24
-
-
Save kpietru/a3cb08ee074a4418795a to your computer and use it in GitHub Desktop.
Expect inside shell + install mysql-server + variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MYSQL_PASSWORD="pass" | |
export MYSQL_PASSWORD="$MYSQL_PASSWORD" | |
# Debug | |
#expect -D 1 -c ' | |
expect -c ' | |
spawn apt-get install -y mysql-server | |
expect "*password* user:" | |
send "$env(MYSQL_PASSWORD)\r" | |
expect "*password* user:" | |
send "$env(MYSQL_PASSWORD)\r" | |
expect "\r" | |
send "enter\r" | |
interact' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment