automate installing tripwire using expect

tripwire is a handy part of an intrusion detection system. It’s a nice piece of software but the installer is interactive which makes it a pain to install automatically (e.g. when using PoolParty/EC2). Below is a simple expect script I whipped up to solve the make install problem. Hopefully this will save someone two or three minutes.

# Usage: expect install-tripwire.tcl pass1 pass2 
set PASS1 [lindex $argv 0]
set PASS2 [lindex $argv 1]
 
spawn make install
 
expect "Press ENTER to view the License Agreement."
send "\r"
send "q"
expect "license agreement. \[do not accept\]"
send "accept\r"
expect "Continue with installation? \[y/n\]"
send "y\r"
 
expect "Enter the site keyfile passphrase:"
send "$PASS1\r"
expect "Verify the site keyfile passphrase:"
send "$PASS1\r"
 
expect "Enter the local keyfile passphrase:"
send "$PASS2\r"
expect "Verify the local keyfile passphrase:"
send "$PASS2\r"
 
expect "Please enter your site passphrase:"
send "$PASS1\r"
 
expect "Please enter your site passphrase:"
send "$PASS1\r"
Share:
  • del.icio.us
  • Reddit
  • Technorati
  • Twitter
  • Facebook
  • Google Bookmarks
  • HackerNews
  • PDF
  • RSS
This entry was posted in deployment, programming, shell, sysadmin, tips. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">