Re: Mathopd Configuration Help

"clemensF" <[email protected]>
Newsgroups gmane.network.mathopd
Organization no
Message-ID <[email protected]>
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.