Click to See Complete Forum and Search --> : please help, script for email installation


Lawes
12-24-2004, 06:00 AM
Dear,

I'm a dummy and weak in programming , thus hope someone can help or give me some hints. Thanks a lot.

Since I'm using Postfix + courier-imap + clamav + spamassassin + amavisd-new + mysql + postfixadmin for my email server . Everytime I install this system, I need to handle too much config file ~

Now I trying to write a script for:
1). accept variable (domain name, passowrd)
2). search a config file for specific line, and replace with predefined parameter
3). able to compile file(make, make install)

thx
From Lawes

Lawes
12-25-2004, 04:01 AM
Dear all,

I now can read in a variable, but I don't know how to search a line like:
myhostname = domain.com
and replace to:
myhostname = variable

any hints ?

thx a lot

Lawes

bryan.6
01-01-2005, 11:22 PM
hmm... i would say look into sed.

you'll have to look into the sed man 'cause i haven't used it in a bit, but maybe something like

sed -e "s/ myhostname = .*/myhostname = $variable/g" <infile >outfile