> Thomas Seifert:
> Why don't you simply parse the config automatically if the new host
> starts and insert the ip-address automatically?
> Should be simple using sed.
[...]
> > Server {
> > Port 80
> > Virtual {
> > NoHost
> > Control {
> > Alias /
> > Location /usr/local/www
> > Specials {
> > CGI { * }
> > }
> > }
> > }
> > }
the way i do such things is this: write a config.0 file with everything in
it except the "Server {}" part. with a shell/python/ruby/smalltalk/lua-
script i write the constant config.0 first and append the few lines that
have to change on each call. this takes no editing at all.
example:
#!/bin/sh
# script
{
IP="$1"
cat config.0
cat << eeooff
"Server {
Port 80
Virtual {
Host $IP
Control {
Alias /
Location /usr/local/www
Specials {
CGI { * }
}
}
}
}"
eeooff
} | mathopd
to be called as script $ipnumber
--
clemens fischer