As far as I know that is not easy.
You can, however, change those blue dialog screen for something else. e.g. if you do "export DEBIAN_FRONTEND=readline" before the "apt-get" command, then the package configuration program will ask the questions on the terminal.
It looks like then this should work:
Code:
export DEBIAN_FRONTEND=readline
apt-get install slapd <config
# or:
cat config | apt-get install slapd
... but I tried it, and unfortunately it ignores the input from the config file.
The easiest, but abit quick-n-dirty, work-around I can think of now, is to set it so it does not ask any question:
Code:
export DEBIAN_FRONTEND=noninteractive
apt-get install slapd
And then just copy your configuration file(s) over the ones installed by the package. And do some other things the package needs from your script. Like in your example of installing slapd, you probably also want to generate an inital database from an LDIF file.