I am trying to automate installation of tripwire via apt-get through Python's subprocess module in Ubuntu Linux. The problem I have is that during the installation process, Tripwire is prompting me for Postfix mail configuration, setting site.key and local.key through different set of configuration pages (see picture attached) which appear after apt-get has installed.
How can I use subprocess module to interact with these pages?
from subprocess import *
p=Popen("apt-get install tripwire",stdout=PIPE,stdin=PIPE,stderr=PIPE,shell=True)
p.communicate(input="Y\n") # Y = Yes to confirm installation of the package through apt-get
Launch the install with auto-confirm and quiet mode enabled and set this flag:
apt-get install -y -q tripwire
This way you won't need to communicate with the post-install config.
You can also pass along pre-exising
config files with
-c (or specify configuration options with
I would probably try:
from subprocess import call p = call(["apt-get", "install", "-y", "-q", "-c", "config.cfg", "tripwire", shell=False])